Beispiel #1
0
        public static void Main(string[] args)
        {
#if DEBUG
            int startingHour   = DateTime.Now.Hour;
            int startingMinute = DateTime.Now.AddMinutes(1).Minute;

            MyScheduler.IntervalInMinutes(startingHour, startingMinute, 1, () =>
            {
                ChargeController.UpdateTweets();
            });

            MyScheduler.IntervalInMinutes(startingHour, startingMinute, 1, () =>
            {
                TelegramBotController.ProcessMessages();
            });

            Console.ReadLine();
#endif

#if RELEASE
            ChargeController.FirstCharging();

            //Começa às 7h | Intervalo de 1 dia
            MyScheduler.IntervalInDays(7, 00, 1, () =>
            {
                ChargeController.UpdateTweets();
            });

            //Começa às 7h | Intervalo de 1 hora
            MyScheduler.IntervalInHours(7, 00, 1, () =>
            {
                TelegramBotController.ProcessMessages();
            });
#endif
        }
Beispiel #2
0
 private void button4_Click_2(object sender, EventArgs e)
 {
     if (Core.Config.telegramtoken == string.Empty)
     {
         MessageBox.Show(PrivateLocal.TELEGRAM_NO_TOKEN);
     }
     else
     {
         try
         {
             TelegramBotController.StartBot(Core.Config.telegramtoken);
         }
         catch (Exception exception)
         {
             Logger.Fatal(exception.ToString());
         }
     }
 }
Beispiel #3
0
 private void button5_Click(object sender, EventArgs e)
 {
     TelegramBotController.StopBot();
 }