コード例 #1
0
        public async Task Start(string token, ServerBase serverBase, IBotStructureInfo botStructureInfo = null, System.Net.Http.HttpClient httpClient = null)
        {
            if (botStructureInfo == null)
            {
                CurrentBotStructureInfo = new BotStructureInfo();
            }
            else
            {
                CurrentBotStructureInfo = botStructureInfo;
            }
            _serverBase = serverBase;
            _botClient  = new TelegramBotClient(token, httpClient);

            User me = await _botClient.GetMeAsync();

            _botClient.OnCallbackQuery += _botClient_OnCallbackQuery;
            _botClient.OnMessage       += Bot_OnMessage;
            _botClient.StartReceiving();
            CurrentBotStructureInfo.OnStarted(this);
        }