示例#1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            /*MessageController.ControllerBot = new TelegramBot("1158660778:AAEi0BoYtLIRBbfrNh6LmDbv7Lko3SIjppg")
             * {
             *  Name = "TestTelegramShop"
             * };
             * MessageController.ControllerBot.SetWebhook("https://shoptelegrambot.azurewebsites.net/api/message/Update").Wait();*/

            TelegramBot telegramBot = new TelegramBot("1158660778:AAEi0BoYtLIRBbfrNh6LmDbv7Lko3SIjppg",
                                                      "MainTelegramBot",
                                                      "https://shoptelegrambot.azurewebsites.net/TelegramBot/Update");

            telegramBot.SetCommands(new List <ICommand>()
            {
                new StartCommand(),
                new HelpCommand(),
                new HelloCommand(),
                new OrderCommand(telegramBot.StepPool),
                new CatalogueCommand(telegramBot.StepPool)
            });
            BotFactory.AddBot(telegramBot);

            services.AddControllers();
        }