Skip to content

Commit c6e0547

Browse files
authored
Tg captcha (#277)
* added captcha for tg bot * added locale for captcha * added locale for captcha * added locale for captcha * added locale for captcha * added locale for captcha
1 parent a1ce832 commit c6e0547

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/Jobs/TelegramMessage.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ public function __construct(public Collection $message, public ?CaptchaCallback
4141
$this->from = $this->message->dot()->get('from.id');
4242
$this->newChatMember = (bool) $this->message->get('new_chat_member');
4343

44-
$this->locale = collect(config('telegram.chats'))
45-
->where('id', $this->chatId)?->first['locale'] ?? config('telegram.default_locale');
44+
$chatConfig = collect(config('telegram.chats'))
45+
->where('id', $this->chatId)
46+
->first();
47+
48+
$this->locale = $chatConfig ? $chatConfig['locale'] : config('telegram.default_locale');
4649
}
4750

4851
/**

0 commit comments

Comments
 (0)