send a telegram message to yourself, a friend or a channel with node.js
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.travis.yml
README.md
index.js
package-lock.json
package.json

README.md

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!