
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
telekit-cmd
Advanced tools
The module that simplifies work with commands in telekit
npm:
$ npm install telekit telekit-cmd --save
yarn:
$ yarn add telekit telekit-cmd
/** Require `telekit` and `telekit-cmd` */
const telekit = require('telekit');
const telecmd = require('telekit-cmd');
/** Create a new `telekit` instance */
const bot = telekit(options);
/** Connect `telekit-cmd` to instance */
bot.use(telecmd);
/** And start listening! */
bot.on('/ping', (context) => {
context.chat.sendMessage({
text: 'Pong!',
});
});
Coming soon...
context.command
/** ... */
const bot = telekit(options);
bot.use(telecmd);
bot.message = (context) => {
if (context.command.name == 'hello') {
return context.chat.sendMessage({
text: 'Glad to see you!',
});
}
};
Events
/** ... */
const bot = telekit(options);
bot.use(telecmd);
/** Listen of all commands */
bot.on('command', (context) => {
context.chat.sendMessage({
text: `Command ${context.command.name} is not implemented 😞`,
});
});
/** Listens only a given command */
bot.on('/meow', (context) => {
context.chat.sendMessage({
text: 'Woof, woooof-woof! 🐶',
});
});
/** ... */
Method
command
for the instance
/** ... */
const bot = telekit(options);
bot.use(telecmd);
bot.command = (context) => {
if (context.command.name == 'source') {
context.chat.sendMessage({
text: '[Source code available on Github](https://github.com/telekits/telekit-cmd) ❤️️',
parse_mode: 'markdown',
});
}
}
/** ... */
Method
command
for the custom helpers
/** ... */
const bot = telekit(options);
bot.use(telecmd);
bot.use(class MyBestClassHelper {
command(context, next) {
if (context.command.name == 'start') {
return context.chat.sendMessage({
text: 'Welcome to My Super Awesome Bot! 😊',
});
}
next();
}
});
/** ... */
FAQs
The module that simplifies work with commands in telekit
The npm package telekit-cmd receives a total of 3 weekly downloads. As such, telekit-cmd popularity was classified as not popular.
We found that telekit-cmd 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.