Skip to content

send a telegram message to yourself, a friend or a channel with node.js

Notifications You must be signed in to change notification settings

christian-fei/simple-telegram-message

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-telegram-message

… aims to be a simple, dependency-less module that does one thing, and it does it well

send a telegram message to yourself, a friend or a channel with node.js

requirements

to get a your user id, search on telegram for the bot @userinfobot.

to get the telegram bot token, create a bot with the help of @BotFather and he will provide you with all the information you need :)

two step usage

npm i simple-telegram-message
const { sendMessageFor } = require('simple-telegram-message')
const sendMessage = sendMessageFor(process.env.TELEGRAM_TOKEN, 'user_id|channel_id')
sendMessage(`Hi from bot!`)

api

sendMessageFor

this function is the only one exported by simple-telegram-message, and it is used to create a new function (see sendMessage)

sendMessage

sendMessage is the function returned by sendMessageFor.

it returns a promise that resolves when the message has been successfully sent, or rejects if the message failed.

help

reach out on twitter @christian_fei!

About

send a telegram message to yourself, a friend or a channel with node.js

Resources

Stars

Watchers

Forks

Packages