diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 9d9878ead..342199b28 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3430,7 +3430,8 @@ void HistoryWidget::sendBotCommand( bool lastKeyboardUsed = (_keyboard->forMsgId() == FullMsgId(_channel, _history->lastKeyboardId)) && (_keyboard->forMsgId() == FullMsgId(_channel, replyTo)); - const auto toSend = replyTo + // 'bot' may be nullptr in case of sending from FieldAutocomplete. + const auto toSend = (replyTo || !bot) ? cmd : HistoryView::WrapBotCommandInChat(_peer, cmd, bot);