File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
app/Filament/Pages/Settings Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -214,19 +214,27 @@ public function sendTestTelegramNotification()
214214 {
215215 $ notificationSettings = new (NotificationSettings::class);
216216
217- if (count ($ notificationSettings ->telegram_recipients )) {
217+ $ bot = config ('telegram.bot ' );
218+
219+ if (blank ($ bot )) {
220+ Notification::make ()
221+ ->title ('First you need to add \'TELEGRAM_BOT_TOKEN \' on your .env file or add it as environment variable ' )
222+ ->warning ()
223+ ->send ();
224+ }
225+ if (! empty ($ notificationSettings ->telegram_recipients )) {
218226 foreach ($ notificationSettings ->telegram_recipients as $ recipient ) {
219227 \Illuminate \Support \Facades \Notification::route ('telegram_chat_id ' , $ recipient ['telegram_chat_id ' ])
220228 ->notify (new TelegramNotification ('Test notification channel *telegram* ' ));
221229 }
222230
223231 Notification::make ()
224- ->title ('Test telegram notification sent. ' )
232+ ->title ('Test Telegram notification sent. ' )
225233 ->success ()
226234 ->send ();
227235 } else {
228236 Notification::make ()
229- ->title ('You need to add recipients to receive telegram notifications. ' )
237+ ->title ('You need to add recipients to receive Telegram notifications. ' )
230238 ->warning ()
231239 ->send ();
232240 }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return [
4+ 'bot ' => env ('TELEGRAM_BOT_TOKEN ' , null ),
5+ ];
You can’t perform that action at this time.
0 commit comments