示例#1
0
 public Bot(TelegramAPI _api)
 {
     if (_api != null)
     {
         tAPI = _api;
     }
     else
     {
         tAPI = new TelegramAPI();
     }
 }
示例#2
0
        static void Main(string[] args)
        {
            Logo.Print();

            int num = 0;

            int delay_time = AppSettings.MailCheckDelay; // delay for checking e'mail

            TelegramAPI API       = new TelegramAPI();
            Bot         ZabbixBot = new Bot(API);

            TimerCallback tm    = new TimerCallback(Count);
            Timer         timer = new Timer(tm, num, delay_time, delay_time);

            while (true)
            {
                ZabbixBot.GetMessage();
                if (mails.Count > 0)
                {
                    ZabbixBot.SendMessageAll(mails);
                    mails.Clear();
                }
            }
        }