Skip to content

Commit

Permalink
Show error when message edit fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklul committed Oct 29, 2023
1 parent 6e4470a commit 8936f9b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Command/Admin/StatsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ public function execute(): ServerResponse
return Request::sendMessage($data);
} elseif ($callback_query) {
$data['message_id'] = $callback_query->getMessage()->getMessageId();
Request::editMessageText($data);
$result = Request::editMessageText($data);

if (!$result->isOk()) {
$data_query['show_alert'] = true;
$data_query['text'] = substr($result->getDescription(), 0, 200);
}

return Request::answerCallbackQuery($data_query);
}
Expand Down

0 comments on commit 8936f9b

Please sign in to comment.