Fix sending bot commands from autocomplete.

This commit is contained in:
John Preston 2020-11-18 14:49:42 +03:00
parent c3b0e6c503
commit c98a3825a5

View file

@ -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);