1.0.9 • Published 8 years ago
auth-tg v1.0.9
auth-tg
Simple Auth Middleware (node-telegram-bot-api)
Install
npm i --save auth-tg
Usage
var TelegramBot = require('node-telegram-bot-api');
var auth = require('auth-tg');
// telegram bot
var bot = new TelegramBot(token);
// secure bot
var secure = auth.wrap(bot, [/* array of id */]);
Functions
wrap(bot, authorized)
- bot: node-telegram-bot-api bot.
- authorized: array of authorized id.
Return wrapped bot.
Secure Functions
onText
Secure Events
Subset of events
auth@message
auth@text
auth@audio
auth@document
,auth@photo
auth@sticker
auth@video
auth@voice
auth@contact
auth@location
auth@callback_query
auth@inline_query
auth@chosen_inline_result
auth@edited_message
Author
Francesco Cannizzaro