private async Task OnBotMessage(ITelegramBotClient client, Message message, CancellationToken cancellationToken) { _logger.LogDebug("Received a text message in {ChatId}, from: {UserId}. Message: {Message}", message.Chat.Id, message.From.Id, message.Text); if (message.Text?.StartsWith('/') == true) { await client.SendChatActionAsync(message.Chat, ChatAction.Typing, cancellationToken); await AnswerBotCommandAsync(client, message, cancellationToken); } else if (_session.Get(message.Chat.Id) is ChatSession session) { await client.SendChatActionAsync(message.Chat, ChatAction.Typing, cancellationToken); switch (session.Scope) { case SessionScope.Login: await _startCommand.Login(client, message, cancellationToken); break; default: break; } } return; }