Example #1
0
        private static void Main(string[] args)
        {
            using (SqliteConnection db = new SqliteConnection("Filename=dril.db"))
            {
                db.Open();
                String        tableCommand  = "CREATE TABLE IF NOT EXISTS tweets6 (Id NVARCHAR(2048) PRIMARY KEY, Content NVARCHAR(2048))";
                String        tableCommand2 = "CREATE TABLE IF NOT EXISTS starters3 (Word NVARCHAR(2048))";
                String        tableCommand3 = "CREATE TABLE IF NOT EXISTS words3 (Word NVARCHAR(2048), Next NVARCHAR(2048))";
                SqliteCommand createTable   = new SqliteCommand(tableCommand, db);
                SqliteCommand createTable2  = new SqliteCommand(tableCommand2, db);
                SqliteCommand createTable3  = new SqliteCommand(tableCommand3, db);
                //Console.Write(ConfigurationManager.ConnectionStrings[db].ConnectionString);
                try
                {
                    createTable.ExecuteReader();
                    createTable2.ExecuteReader();
                    createTable3.ExecuteReader();
                }
                catch (SqliteException e)
                {
                    Console.Write("bad");
                    throw new Exception(e.Message);
                }
                db.Close();
            }
            IRCConfig conf = new IRCConfig();

            conf.name     = "YOUR_NAME_HERE";
            conf.nick     = "YOUR_NAME_HERE";
            conf.port     = 6667;
            conf.channel  = "YOUR_CHANNELS_HERE";
            conf.server   = "irc.chat.twitch.tv";
            conf.password = "******";
            fetchTweets();
            Timer timer1 = new System.Windows.Forms.Timer();

            timer1.Tick    += new EventHandler(fetchTweetsTimed);
            timer1.Interval = 86400000;
            timer1.Start();
            using (var bot = new IRCBot(conf))
            {
                conf.joined = false;
                bot.Connect();
                bot.IRCWork();
            }
            Console.WriteLine("Bot quit/crashed");
            Console.ReadLine();
        }
Example #2
0
 public IRCBot(IRCConfig config)
 {
     this.config  = config;
     lastInput    = 0;
     timeRecorder = new List <Antispam>();
 }