File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -331,15 +331,18 @@ export const sendNotification = async (message: string) => {
331
331
if ( getSecret ( "NOTIFICATION_TELEGRAM" ) && getSecret ( "NOTIFICATION_TELEGRAM_BOT_KEY" ) ) {
332
332
console . log ( "Sending Telegram" ) ;
333
333
try {
334
- await axios . post (
335
- `https://api.telegram.org/bot${ getSecret ( "NOTIFICATION_TELEGRAM_BOT_KEY" ) } /sendMessage` ,
336
- {
337
- parse_mode : "Markdown" ,
338
- disable_web_page_preview : true ,
339
- chat_id : getSecret ( "NOTIFICATION_TELEGRAM_CHAT_ID" ) ,
340
- text : message . replace ( / _ / g, '\\_' ) ,
341
- }
342
- ) ;
334
+ const chatIds = getSecret ( "NOTIFICATION_TELEGRAM_CHAT_ID" ) . split ( "," ) ;
335
+ for ( const chatId of chatIds ) {
336
+ await axios . post (
337
+ `https://api.telegram.org/bot${ getSecret ( "NOTIFICATION_TELEGRAM_BOT_KEY" ) } /sendMessage` ,
338
+ {
339
+ parse_mode : "Markdown" ,
340
+ disable_web_page_preview : true ,
341
+ chat_id : chatId . trim ( ) ,
342
+ text : message . replace ( / _ / g, '\\_' ) ,
343
+ }
344
+ ) ;
345
+ }
343
346
console . log ( "Success Telegram" ) ;
344
347
} catch ( error ) {
345
348
console . log ( "Got an error" , error ) ;
You can’t perform that action at this time.
0 commit comments