Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

captcha_only_bot

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

captcha_only_bot - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

package.json
{
"name": "captcha_only_bot",
"version": "0.0.3",
"version": "0.0.4",
"description": "Bot admin captcha",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -20,51 +20,50 @@ require('dotenv').config()

const bot = new Telegraf(BOT_TOKEN, { username: BOT_NAME })
const init = async (bot, dbConfig) => {
bot.context.database = knex(dbConfig)
bot.context.database = knex(knexConfig)
/**
* Middlewares
*/
bot.use(session())
bot.use(userMiddleware())
bot.use(debugMiddleware())
/**
* Middlewares
*/
bot.use(session())
bot.use(userMiddleware())
bot.use(debugMiddleware())
/**
* Handlers
*/
bot.hears(/[\S\s]*/, hearsHandler())
bot.on('new_chat_members', newChatMemberHandler())
bot.on('left_chat_member', leftChatMemberHandler())
/**
* Handlers
*/
bot.hears(/[\S\s]*/, hearsHandler())
bot.on('new_chat_members', newChatMemberHandler())
bot.on('left_chat_member', leftChatMemberHandler())
/**
* Actions
*/
bot.action(/^([.\d]{15,22})=(\d+)/, passAction())
bot.action(/^action=(\w+)/, actionsAction())
bot.action(/^settings=(\w+)&field=(\w+)/, editSettingAction())
/**
* Actions
*/
bot.action(/^([.\d]{15,22})=(\d+)/, passAction())
bot.action(/^action=(\w+)/, actionsAction())
bot.action(/^settings=(\w+)&field=(\w+)/, editSettingAction())
/**
* Commands
*/
bot.start(startCommand())
bot.command('settings', settingsCommand())
/**
* Commands
*/
bot.start(startCommand())
bot.command('settings', settingsCommand())
return bot
}
/**
* Run
* Init bot function.
*
* @param {Telegraf} bot The bot instance.
* @param {Object} dbConfig The knex connection configuration.
* @return {Promise<Telegraf>} Bot ready to launch.
*/
bot.startPolling()
init(new Telegraf(BOT_TOKEN, { username: BOT_NAME }), knexConfig)
.then((bot) => {
/**
* Run
*/
bot.startPolling()
})
module.exports = {
on: {
new_chat_members: newChatMemberHandler,
left_chat_member: leftChatMemberHandler,
},
action: {
'/^([.\\d]{15,22})=(\\d+)/': passAction,
'/^action=(\\w+)/': actionsAction,
'/^settings=(\\w+)&field=(\\w+)/': editSettingAction,
},
hears: {
'/[\\S\\s]*/': hearsHandler,
},
}
module.exports = init
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc