Exemplo n.º 1
0
        /// <summary>
        ///     Send a message to cleverbot asynchronously and get a response.
        /// </summary>
        /// <param name="message">your message sent to cleverbot</param>
        /// <returns>response from the cleverbot.com api</returns>
        public async Task <CleverbotResponse> GetResponseAsync(string message)
        {
            LastMessageSent = DateTime.Now;
            var resp = await CleverbotResponse.CreateAsync(message, _conversationState, _apiKey);

            _conversationState = resp.ConversationState;
            return(resp);
        }
Exemplo n.º 2
0
 public CleverbotResponse GetResponse(string message)
 {
     return(CleverbotResponse.CreateAsync(message, "", ApiKey).GetAwaiter().GetResult());
 }
Exemplo n.º 3
0
 /// <summary>
 /// Send a message to cleverbot asynchronously and get a response.
 /// </summary>
 /// <param name="message">your message sent to cleverbot</param>
 /// <returns>response from the cleverbot.com api</returns>
 public Task <CleverbotResponse> GetResponseAsync(string message)
 {
     return(CleverbotResponse.CreateAsync(message, "", ApiKey));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Send a message to cleverbot asynchronously and get a response.
 /// </summary>
 /// <param name="message">your message sent to cleverbot</param>
 /// <returns>response from the cleverbot.com api</returns>
 public Task <CleverbotResponse> GetResponseAsync(string message, int?wacky = null, int?talkative = null, int?attentive = null)
 {
     return(CleverbotResponse.CreateAsync(message, "", ApiKey, wacky, talkative, attentive));
 }