protected SendChatMessage ( int delayMs, string message ) : void | ||
delayMs | int | The delay, in milliseconds, to wait before sending the message |
message | string | The message to send to the other user |
return | void |
public async void ChatAsync(UserHandler user, string msg) { if (pendingMessages.Contains(user.OtherSID)) // don't let them chat if they didn't get a response yet { return; } AddPending(user.OtherSID); try { string response = await ThinkAsync(msg); if (user.GetState() != EPersonaState.Offline) // in case they disconnected { user.SendChatMessage(response); } } catch (System.Net.WebException ex) { user.Bot.Log.Error("WebException occured in ChatSession: {0}", ex.Message); } RemovePending(user.OtherSID); }