예제 #1
0
파일: Program.cs 프로젝트: dm1989/ChatBot
        static void Main(string[] args)
        {
            //ShowWindow(GetConsoleWindow(), 0);
            DotaModule.heros = FileModule.JsonToClass <List <Heros> >("Heros.json");
            var twitchIRC = new IRCClient();

            Console.ReadLine();
        }
예제 #2
0
파일: IRCClient.cs 프로젝트: dm1989/ChatBot
        private void ConnectIrc()
        {
            var IRCChannels = FileModule.JsonToClass <List <IRCChannel> >("BotUsers.json");

            irc = new TcpClient("irc.twitch.tv", 6667);
            var stream = irc.GetStream();

            reader = new StreamReader(stream);
            writer = new StreamWriter(stream);
            writer.WriteLine("PASS " + Program.BotDetails.TwitchOauth
                             + Environment.NewLine
                             + "NICK " + Program.BotDetails.TwitchNick + Environment.NewLine
                             + "USER " + Program.BotDetails.TwitchNick + " 8 * :" + Program.BotDetails.TwitchNick);
            writer.WriteLine("JOIN #" + Program.BotDetails.TwitchNick);
            foreach (IRCChannel c in IRCChannels)
            {
                writer.WriteLine("JOIN #" + c.ChannelName);
            }
            writer.Flush();
        }