Example #1
0
 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);
     }
 }
Example #3
0
        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);
        }
Example #4
0
 public void SendWhisper(string Receiver, string message)
 {
     client.SendWhisper(Receiver, message);
 }