瀏覽代碼

fix: missing null handle in tg bot service

M1Screw 1 年之前
父節點
當前提交
53285b6ea5
共有 1 個文件被更改,包括 2 次插入2 次删除
  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'] ?? [],
                         ]
                     ),
                 ]