示例#1
0
        static void Main(string[] args)
        {
            InitializeDbRedis();

            Console.OutputEncoding = Encoding.UTF8;

            var telegramBotToken  = "XXX"; // your token here
            var telegramBotClient = new TelegramBotClient(telegramBotToken);
            var facade            = new Telegram.TelegramBotClientFacade(telegramBotClient);

            telegramBotClient.OnMessage += Bot_OnMessage;

            var eventRepository = new EventRepository();

            eventRepository.AddScheduleToEvent(
                SpecialDiscountEventPublisher.Instance,
                TimeSpan.FromSeconds(15));

            eventRepository.RunWorker(facade);

            telegramBotClient.StartReceiving();

            Console.ReadLine();
        }