Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ bot.on("updateError", function (err) {

bot.on("synced", function () {
console.log("Bot ready.");
const axios = require('axios');
const message = 'the Bot started';
const chatId = config.owner;
const apiUrl = `https://api.telegram.org/bot${config.authToken}`;
axios.post(`${apiUrl}/sendMessage`, {
chat_id: chatId,
text: message
}).then(response => {
console.log('Message sent:', response.data.result.text);
}).catch(error => {
console.error('Error sending message:', error.response.data.description);
});
});


Expand Down