示例#1
0
        static void Main(string[] args)
        {
            if (Settings.Name != string.Empty && Settings.Channel != string.Empty && Settings.OAuth != string.Empty)
            {
                TwitchUser user = new TwitchUser(Settings.Name, Settings.OAuth);
                TwitchBot bot = new TwitchBot(user, Settings.Channel);
            }
            else Console.WriteLine("Some settings are invalid");

            Console.ReadLine();
        }
示例#2
0
        public TwitchBot(TwitchUser user, string channel)
        {
            Channel = channel;

            con = new Connection(user.Nick, Channel, user.OAuth);
            con.OnConnect += OnConnect;
            con.OnChat += OnChat;
            con.OnCommandPerformed += OnCommandPerformed;

            do
            {
                con.Say(Console.ReadLine());
            }
            while (Console.ReadLine() != string.Empty || Console.ReadLine() != null);
        }