From fbda5ff15716e6c863f929a8eb0e0ec4fae63973 Mon Sep 17 00:00:00 2001 From: TangMo Date: Fri, 30 Dec 2022 01:39:50 +0000 Subject: [PATCH] Switch to replyToChat --- src/Commands/GenericmessageCommand.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Commands/GenericmessageCommand.php b/src/Commands/GenericmessageCommand.php index c7aa363..4cbee87 100755 --- a/src/Commands/GenericmessageCommand.php +++ b/src/Commands/GenericmessageCommand.php @@ -22,10 +22,7 @@ class GenericmessageCommand extends SystemCommand $message = $this->getMessage(); $chat_id = $message->getChat()->getId(); if(count($allowed_chat_ids) > 0 && !in_array($chat_id, $allowed_chat_ids)) { - return Request::sendMessage([ - 'chat_id' => $chat_id, - 'text' => "Chat ID $chat_id not allowed", - ]); + return $this->replyToChat("Chat ID $chat_id not allowed"); } $text = $message->getText(true); @@ -41,11 +38,12 @@ class GenericmessageCommand extends SystemCommand $tweetId = $matches[2]; $tail = $matches[3] ?? ''; - return Request::sendMessage([ - 'chat_id' => $chat_id, - 'reply_to_message_id' => $message->getMessageId(), - 'text' => "https://fxtwitter.com/$author/status/$tweetId$tail", - 'disable_notification' => true, - ]); + return $this->replyToChat( + "https://fxtwitter.com/$author/status/$tweetId$tail", + [ + 'reply_to_message_id' => $message->getMessageId(), + 'disable_notification' => true, + ] + ); } } \ No newline at end of file