Browse Source

fix: missing null handle in tg bot service

M1Screw 1 year ago
parent
commit
53285b6ea5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Services/Bot/Telegram/Commands/MenuCommand.php

+ 2 - 2
src/Services/Bot/Telegram/Commands/MenuCommand.php

@@ -57,13 +57,13 @@ final class MenuCommand extends Command
             // 回送信息
             return $this->replyWithMessage(
                 [
-                    'text' => $reply['text'],
+                    'text' => $reply['text'] ?? 'Hi!',
                     'parse_mode' => 'Markdown',
                     'disable_web_page_preview' => false,
                     'reply_to_message_id' => null,
                     'reply_markup' => json_encode(
                         [
-                            'inline_keyboard' => $reply['keyboard'],
+                            'inline_keyboard' => $reply['keyboard'] ?? [],
                         ]
                     ),
                 ]