electra13x7777

C# Twitch Bot Connection and Commands

Nov 20th, 2015
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using TwitchmIRCbot;
  2. namespace TwitchBot
  3. {
  4.     class Program
  5.     {
  6.         static void Main(string[] args)
  7.         {
  8.             IrcClient irc = new IrcClient("irc.twitch.tv", 6667, "[BOT USERNAME HERE]", "[OAUTH HERE]");
  9.             irc.joinRoom("[TWITCH CHANNEL HERE]");
  10.             while (true)
  11.             {
  12.                 string message = irc.ReadMessage();
  13.  
  14.                 //commands
  15.         //here is a test command to check if the bot is connected to your desired chat
  16.                 if (message.Contains("!test"))
  17.                 {
  18.                     irc.SendChatMessage("Working"));
  19.         }
  20.         }
  21.      }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment