mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 11:58:02 +08:00
Better handling
This commit is contained in:
@@ -9,12 +9,16 @@ class Telegram extends NotificationProvider {
|
||||
let okMsg = "Sent Successfully.";
|
||||
|
||||
try {
|
||||
let params = {
|
||||
chat_id: notification.telegramChatID,
|
||||
text: msg,
|
||||
};
|
||||
if (notification.telegramMessageThreadID) {
|
||||
params.message_thread_id = notification.telegramMessageThreadID;
|
||||
}
|
||||
|
||||
await axios.get(`https://api.telegram.org/bot${notification.telegramBotToken}/sendMessage`, {
|
||||
params: {
|
||||
chat_id: notification.telegramChatID,
|
||||
text: msg,
|
||||
message_thread_id: notification.telegramMessageThreadID,
|
||||
},
|
||||
params: params,
|
||||
});
|
||||
return okMsg;
|
||||
|
||||
|
Reference in New Issue
Block a user