@@ -41,6 +41,14 @@ public function __construct(private TelegramBotConfig $config)
4141 $ this ->initialize ();
4242 }
4343
44+ /**
45+ * {@inheritDoc}
46+ */
47+ public function getConfig (): array
48+ {
49+ return $ this ->config ->serialize ();
50+ }
51+
4452 /**
4553 * {@inheritDoc}
4654 */
@@ -55,7 +63,7 @@ public function initialize(): Telegram
5563
5664 return $ this ->bot ;
5765 } catch (TelegramException | TelegramLogException | \Exception $ exception ) {
58- throw new \Exception (sprintf ("'%s' " , $ exception ->getMessage ()));
66+ throw new \Exception (sprintf ("%s " , $ exception ->getMessage ()));
5967 }
6068 }
6169
@@ -153,7 +161,7 @@ public function webhookHandler(): void
153161 try {
154162 $ this ->bot ->handle ();
155163 } catch (TelegramException | \Exception $ exception ) {
156- throw new \Exception (sprintf ("'%s' " , $ exception ->getMessage ()));
164+ throw new \Exception (sprintf ("%s " , $ exception ->getMessage ()));
157165 }
158166 }
159167
@@ -165,7 +173,7 @@ public function setWebhook(): ServerResponse
165173 try {
166174 return $ this ->bot ->setWebhook ($ this ->config ->webhook ()["url " ]);
167175 } catch (TelegramException | \Exception $ exception ) {
168- throw new \Exception (sprintf ("'%s' " , $ exception ->getMessage ()));
176+ throw new \Exception (sprintf ("%s " , $ exception ->getMessage ()));
169177 }
170178 }
171179
@@ -177,7 +185,7 @@ public function unsetWebhook(): ServerResponse
177185 try {
178186 return $ this ->bot ->deleteWebhook ();
179187 } catch (TelegramException | \Exception $ exception ) {
180- throw new \Exception (sprintf ("'%s' " , $ exception ->getMessage ()));
188+ throw new \Exception (sprintf ("%s " , $ exception ->getMessage ()));
181189 }
182190 }
183191}
0 commit comments