Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
node-telegram-bot-api
Advanced tools
Node.js module to interact with official Telegram Bot API. A bot token is needed, to obtain one, talk to @botfather and create a new bot.
npm install node-telegram-bot-api
var TelegramBot = require('node-telegram-bot-api');
var token = 'YOUR_TELEGRAM_BOT_TOKEN';
// Setup polling way
var bot = new TelegramBot(token, {polling: true});
bot.on('message', function (msg) {
var chatId = msg.chat.id;
// photo can be: a file path, a stream or a Telegram file_id
var photo = 'bot.gif';
bot.sendPhoto(chatId, photo, {caption: "I'm a bot!"});
});
There are some other examples on examples.
Both request method to obtain messages are implemented. To use standard polling, set polling: true
on options
. Notice that webHook will need a valid (not self signed) SSL certificate.
Emmits message
when a message arrives.
See: https://core.telegram.org/bots/api
Returns basic information about the bot in form of a User
object.
Specify an url to receive incoming updates via an outgoing webHook.
See: https://core.telegram.org/bots/api#setwebhook
Use this method to receive incoming updates using long polling
See: https://core.telegram.org/bots/api#getupdates
Send text message.
See: https://core.telegram.org/bots/api#sendmessage
Forward messages of any kind.
Send photo
See: https://core.telegram.org/bots/api#sendphoto
file_id
previously uploadedSend audio
See: https://core.telegram.org/bots/api#sendaudio
file_id
previously uploaded.Send Document
See: https://core.telegram.org/bots/api#sendDocument
file_id
previously uploaded.Send .webp stickers.
See: https://core.telegram.org/bots/api#sendsticker
file_id
previously uploaded.Send video files, Telegram clients support mp4 videos (other formats may be sent whith sendDocument
)
See: https://core.telegram.org/bots/api#sendvideo
file_id
previously uploaded.Send chat action.
typing
for text messages,
upload_photo
for photos, record_video
or upload_video
for videos,
record_audio
or upload_audio
for audio files, upload_document
for general files,
find_location
for location data.
See: https://core.telegram.org/bots/api#sendchataction
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
See: https://core.telegram.org/bots/api#getuserprofilephotos
Send location. Use this method to send point on the map.
See: https://core.telegram.org/bots/api#sendlocation
FAQs
Telegram Bot API
The npm package node-telegram-bot-api receives a total of 61,847 weekly downloads. As such, node-telegram-bot-api popularity was classified as popular.
We found that node-telegram-bot-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.