private async void OnMessage(object sender, MessageEventArgs e, TelegramBotClient client, int tenantId)
 {
     if (string.IsNullOrEmpty(e.Message.Text) || e.Message.Text[0] != '/')
     {
         return;
     }
     await command.HandleCommand(e.Message, client, tenantId);
 }
Пример #2
0
        async Task HandleUpdateAsync(ITelegramBotClient botClient, Update update, CancellationToken cancellationToken, int tenantId)
        {
            if (update.Type != UpdateType.Message)
            {
                return;
            }

            if (update.Message.Type != MessageType.Text)
            {
                return;
            }

            if (String.IsNullOrEmpty(update.Message.Text) || update.Message.Text[0] != '/')
            {
                return;
            }

            await command.HandleCommand(update.Message, botClient, tenantId);
        }