
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
telegraf-command-handler
Advanced tools
A command handler for Telegraf, which is similar to the command handler for Discord.js and such. The goal is that all commands are not in 1 file... But divided into several different files.
npm i telegraf-command-handler
# or
yarn add telegraf-command-handler
# or
pnpm add telegraf-command-handler
/* main file */
const { Telegraf } = require('telegraf');
const { TelegrafCommandHandler } = require('telegraf-command-handler');
const path = require('path');
const bot = new Telegraf('Your bot token');
const CommandHandler = new TelegrafCommandHandler({
path: path.resolve() + "/path/to/dir",
});
bot.use(CommandHandler.load());
// ...bot.launch()
/* command file */
module.exports = {
name: "start",
async execute(ctx) {
ctx.reply("hello world");
}
}
interface Options {
/* path to your command directory */
path: string;
/* a function that executed when error comes from your command file */
errorHandling: (ctx: Context, error: any) => any | undefined;
}
module.exports = {
/* command name (it will executed like /echo) */
name: "echo",
/* optional command aliases (can be string or Array<string>) */
aliases: ["say"],
/* command code */
async execute(ctx, args) {
ctx.reply(args.join(" "))
}
}
FAQs
just a command handler for Telegraf
We found that telegraf-command-handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.