From cd5daa720fcacf3f2256541e33090b0b215032bb Mon Sep 17 00:00:00 2001 From: Mahdi Saremi Date: Sun, 22 Dec 2024 13:43:15 +0330 Subject: [PATCH] suggested to edit message in dialogs --- src/Action/Section/Dialog.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Action/Section/Dialog.php b/src/Action/Section/Dialog.php index 6a48011..e521ed3 100644 --- a/src/Action/Section/Dialog.php +++ b/src/Action/Section/Dialog.php @@ -215,6 +215,21 @@ public function reload($message = null, array $args = [], ...$namedArgs) return $dialogRegister->register()->editResponse($message, $args, ...$namedArgs); } + /** + * Send or edit dialog + * + * @param $message + * @param array $args + * @param ...$namedArgs + * @return Message|null + */ + public function response($message = null, array $args = [], ...$namedArgs) + { + return isset($this->responseUsing) || !$this->update->callbackQuery ? + parent::response($message, $args, $namedArgs) : + $this->editResponse($message, $args, ...$namedArgs); + } + /** * Send menu as message