예제 #1
0
        static void Main(string[] args)
        {
            const string connectionString =
                "Server=ProductiveDeveloperCode.database.windows.net;Database=TelegramDB;User Id=ProductiveDeveloper;Password=fDx-Vbt-Lvr-7Vg;";

            Telegram.Bot.Storage.Sql.SqlStorage sqlStorage = new Telegram.Bot.Storage.Sql.SqlStorage(connectionString);

            Telegram.Bot.Storage.InMemory.InMemoryStorage inMemoryStorage = new Telegram.Bot.Storage.InMemory.InMemoryStorage();

            Telegram.Receiver.TelegramReceiver reciver        = new Telegram.Receiver.TelegramReceiver("984957183:AAECP59aHpYez0iBzmw_QBMb-sxMRgO5vpM");
            Telegram.Sender.TelegramSender     telegramSender = new Telegram.Sender.TelegramSender(reciver.botClient);
            Telegram.Domain.Reminders.Reminder reminder       = new Telegram.Domain.Reminders.Reminder(telegramSender);


            Telegram.Domain.BotDomain botDomain = new Telegram.Domain.BotDomain(telegramSender, reciver, sqlStorage, inMemoryStorage, reminder);

            System.Console.WriteLine(reciver.GetHelloFromBot());
            reciver.Run();

            while (true)
            {
                System.Threading.Thread.Sleep(1800000);
                reminder.RemindersUpdate();
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            FileStorage fileStorage = new FileStorage(AppDomain.CurrentDomain.BaseDirectory);

            Telegram.Bot.Storage.InMemory.InMemoryStorage inMemoryStorage = new Telegram.Bot.Storage.InMemory.InMemoryStorage();

            Telegram.Receiver.TelegramReceiver reciver        = new Telegram.Receiver.TelegramReceiver("658409803:AAGD9lg4y7_j976T3o--Gm1p78dQi8JakMA");
            Telegram.Sender.TelegramSender     telegramSender = new Telegram.Sender.TelegramSender(reciver.botClient);
            Telegram.Domain.Reminders.Reminder reminder       = new Telegram.Domain.Reminders.Reminder(telegramSender);


            Telegram.Domain.BotDomain botDomain = new Telegram.Domain.BotDomain(telegramSender, reciver, fileStorage, inMemoryStorage, reminder);

            System.Console.WriteLine(reciver.GetHelloFromBot());
            reciver.Run();

            while (true)
            {
                System.Threading.Thread.Sleep(1800000);
                reminder.RemindersUpdate();
            }
        }