public void SendDirectMessage(string username, string message) { if (_isReady) { _twitchClient.SendWhisper(username, message); } }
/// <summary>SendWhisper wrapper method that will send a whisper back to the user who most recently sent a whisper to this bot.</summary> public static void ReplyToLastWhisper(this ITwitchClient client, string message = "", bool dryRun = false) { if (client.PreviousWhisper != null) { client.SendWhisper(client.PreviousWhisper.Username, message, dryRun); } }
private static Task SendWhisper(ITwitchClient client, string receiver, string message) { var source = new TaskCompletionSource <bool>(); void OnWhisperSent(object a, OnWhisperSentArgs args) { if (args.Message == message && args.Receiver == receiver) { client.OnWhisperSent -= OnWhisperSent; source.SetResult(true); } } client.OnWhisperSent += OnWhisperSent; client.SendWhisper(receiver, message); return(source.Task); }
public void SendWhisper(string Receiver, string message) { client.SendWhisper(Receiver, message); }