Skip to content

Commit 9ee07fb

Browse files
authored
feat: improve telegram setup workflow (#6734)
1 parent f191eda commit 9ee07fb

File tree

30 files changed

+193
-162
lines changed

30 files changed

+193
-162
lines changed

app/Domains/Settings/ManageNotificationChannels/Web/Controllers/TelegramWebhookController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ public function store(Request $request)
2929
// check if the message matches the expected pattern.
3030
// if the message does not match the pattern, then we return a 202 response
3131
// so telegram will stop trying to send the message.
32-
if (! Str::of($messageText)->test('/^\/start\s[A-Za-z0-9-]{36}$/')) {
32+
$message = Str::of($messageText);
33+
if (! $message->test('/^\/start\s[A-Za-z0-9-]{36}$/')) {
3334
return response('Accepted', 202);
3435
}
3536

3637
// Cleanup the string
37-
$verificationKey = Str::of($messageText)->remove('/start ')->rtrim();
38+
$verificationKey = $message->remove('/start ')->rtrim();
3839

3940
// Get Telegram ID from the request.
4041
$chatId = $request->message['chat']['id'];

app/Domains/Settings/ManageNotificationChannels/Web/ViewHelpers/NotificationsIndexViewHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function data(User $user): array
2828
'emails' => $emailsCollection,
2929
'telegram' => [
3030
'data' => $telegram ? self::dtoTelegram($telegram) : null,
31-
'telegram_env_variable_set' => config('services.telegram-bot-api.token'),
31+
'telegram_env_variable_set' => config('services.telegram-bot-api.token') !== null,
3232
],
3333
'url' => [
3434
'settings' => route('settings.index'),

lang/bn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@
826826
"Set as favorite": "প্রিয় হিসাবে সেট করুন",
827827
"Settings": "সেটিংস",
828828
"Settle": "মীমাংসা",
829+
"Setup": "সেটআপ",
829830
"Setup Key": "সেটআপ কী",
830831
"Setup Key:": "সেটআপ কী:",
831832
"Setup Telegram": "টেলিগ্রাম সেটআপ করুন",

lang/ca.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@
826826
"Set as favorite": "Estableix com a favorit",
827827
"Settings": "Configuració",
828828
"Settle": "Resoldre",
829+
"Setup": "Configuració",
829830
"Setup Key": "Clau de configuració",
830831
"Setup Key:": "Clau de configuració:",
831832
"Setup Telegram": "Configura Telegram",

lang/da.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@
826826
"Set as favorite": "Indstil som favorit",
827827
"Settings": "Indstillinger",
828828
"Settle": "Afregne",
829+
"Setup": "Opsætning",
829830
"Setup Key": "Opsætningsnøgle",
830831
"Setup Key:": "Opsætningsnøgle:",
831832
"Setup Telegram": "Opsætning af telegram",

lang/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@
826826
"Set as favorite": "Als Favorit festlegen",
827827
"Settings": "Einstellungen",
828828
"Settle": "Abwickeln",
829+
"Setup": "Aufstellen",
829830
"Setup Key": "Einrichtungsschlüssel",
830831
"Setup Key:": "Setup-Schlüssel:",
831832
"Setup Telegram": "Telegram einrichten",

lang/el.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@
826826
"Set as favorite": "Ορίστε ως αγαπημένο",
827827
"Settings": "Ρυθμίσεις",
828828
"Settle": "Εγκαθίσταμαι",
829+
"Setup": "Ρύθμιση",
829830
"Setup Key": "Κλειδί ρύθμισης",
830831
"Setup Key:": "Κλειδί ρύθμισης:",
831832
"Setup Telegram": "Ρύθμιση Telegram",

lang/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@
826826
"Set as favorite": "Establecer como favorito",
827827
"Settings": "Configuraciones",
828828
"Settle": "Pagar",
829+
"Setup": "Configuración",
829830
"Setup Key": "Clave de configuración",
830831
"Setup Key:": "Clave de configuración:",
831832
"Setup Telegram": "Configurar Telegram",

lang/fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@
826826
"Set as favorite": "Définir comme favori",
827827
"Settings": "Paramètres",
828828
"Settle": "Régler",
829+
"Setup": "Configurer",
829830
"Setup Key": "Clé de configuration",
830831
"Setup Key:": "Clé de configuration :",
831832
"Setup Telegram": "Configurer Telegram",
@@ -1277,4 +1278,4 @@
12771278
"😩 Awful": "😩 Horrible",
12781279
"😶‍🌫️ Neutral": "😶‍🌫️ Neutre",
12791280
"🥳 Awesome": "🥳 Génial"
1280-
}
1281+
}

lang/he.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@
826826
"Set as favorite": "הגדר כמועדף",
827827
"Settings": "הגדרות",
828828
"Settle": "לִשְׁקוֹעַ",
829+
"Setup": "להכין",
829830
"Setup Key": "מפתח הגדרה",
830831
"Setup Key:": "מפתח הגדרה:",
831832
"Setup Telegram": "הגדרת טלגרם",

0 commit comments

Comments
 (0)