コード例 #1
0
        public async static void ProcessInput(this ITelegramBotClient botClient, Update update)
        {
            if (update == null)
            {
                return;
            }
            var message = update.Message;

            if (message?.Type == MessageType.TextMessage)
            {
                if (BotTools.TryParseCommand(message.Text, out string command, out string args))
                {
                    if (VpnBotCommandCollection.Includes(command))
                    {
                        botClient.ProcessCommand(message, command, args);
                    }
                }
                else
                {
                    await botClient.SendTextMessageAsync(message.Chat.Id, "Sorry, i don't understand you.");
                }
            }