Skip to content

Instantly share code, notes, and snippets.

@headStyleColorRed
Last active August 16, 2021 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headStyleColorRed/2f0e5e52560710bf05667844a3d02118 to your computer and use it in GitHub Desktop.
Save headStyleColorRed/2f0e5e52560710bf05667844a3d02118 to your computer and use it in GitHub Desktop.
MEDIUM telegram notification bot
const TelegramBot = require('node-telegram-bot-api');
function sendMessage(message, botId, chatId) {
const bot = new TelegramBot(botId, { polling: false });
try {
bot.sendMessage(chatId, message)
} catch {
return 'Something went wrong when trying to send a Telegram notification'
}
return "Success sending Telegram notification"
}
module.exports = {
sendMessage,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment