Switch to replyToChat

This commit is contained in:
2022-12-30 01:39:50 +00:00
parent f38deaa271
commit fbda5ff157

View File

@@ -22,10 +22,7 @@ class GenericmessageCommand extends SystemCommand
$message = $this->getMessage(); $message = $this->getMessage();
$chat_id = $message->getChat()->getId(); $chat_id = $message->getChat()->getId();
if(count($allowed_chat_ids) > 0 && !in_array($chat_id, $allowed_chat_ids)) { if(count($allowed_chat_ids) > 0 && !in_array($chat_id, $allowed_chat_ids)) {
return Request::sendMessage([ return $this->replyToChat("Chat ID $chat_id not allowed");
'chat_id' => $chat_id,
'text' => "Chat ID $chat_id not allowed",
]);
} }
$text = $message->getText(true); $text = $message->getText(true);
@@ -41,11 +38,12 @@ class GenericmessageCommand extends SystemCommand
$tweetId = $matches[2]; $tweetId = $matches[2];
$tail = $matches[3] ?? ''; $tail = $matches[3] ?? '';
return Request::sendMessage([ return $this->replyToChat(
'chat_id' => $chat_id, "https://fxtwitter.com/$author/status/$tweetId$tail",
[
'reply_to_message_id' => $message->getMessageId(), 'reply_to_message_id' => $message->getMessageId(),
'text' => "https://fxtwitter.com/$author/status/$tweetId$tail",
'disable_notification' => true, 'disable_notification' => true,
]); ]
);
} }
} }