Skip to content

Commit 831e810

Browse files
committed
Fixed an endless dialog in menu.
1 parent 11e37c0 commit 831e810

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ Use this command to get an ID of any chat.
7777
It will be helpful when you'll configure receiving deployment notifications to other chat.
7878
Please note that if you have more than one bots in your target chat then you have to write bot's username after the command without space (/showchatid@LaravelForgeBot).
7979

80+
## Using this bot in groups
81+
82+
Note that this bot has no access to messages in groups.
83+
So, when you add a new token you have to send token as an answer to the last bot's message.
84+
The same action required when you add a webhook to another chat and have to send a chat id.
85+
8086
## Versioning
8187

8288
We use [SemVer](http://semver.org) for versioning. For the versions available, see the [releases on this repository](https://github.com/itorgov/laravel-forge-bot/releases).

app/Integrations/Telegram/IrazasyedTelegramBot.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,20 @@ private function processCallbackQuery(Update $update): void
178178
*
179179
* @param Update $update
180180
*
181-
* @return void
181+
* @return bool
182182
*/
183-
private function processCommand(Update $update): void
183+
private function processCommand(Update $update): bool
184184
{
185+
if (! $this->updateIsCommand($update)) {
186+
return false;
187+
}
188+
185189
// Every command will finish all current user's dialogs and menu dialogs.
186190
Auth::user()->finishAllCurrentDialogs();
187191

188192
$this->telegram->processCommand($update);
193+
194+
return true;
189195
}
190196

191197
/**
@@ -274,13 +280,11 @@ public function handle(Request $request): void
274280
}
275281

276282
if ($update->isType('message') || $update->isType('channel_post')) {
277-
if ($this->botWasKickedFromChat($update) || $this->messageForMenu($update)) {
278-
return;
279-
}
280-
281-
if ($this->updateIsCommand($update)) {
282-
$this->processCommand($update);
283-
283+
if (
284+
$this->botWasKickedFromChat($update) ||
285+
$this->processCommand($update) ||
286+
$this->messageForMenu($update)
287+
) {
284288
return;
285289
}
286290

0 commit comments

Comments
 (0)