telekit-cmd
The module that simplifies work with commands in telekit
Install
npm:
$ npm install telekit telekit-cmd --save
yarn:
$ yarn add telekit telekit-cmd
Usage
/** Require `telekit` and `telekit-cmd` */const telekit = ;const telecmd = ; /** Create a new `telekit` instance */const bot = ; /** Connect `telekit-cmd` to instance */bot; /** And start listening! */bot;
Documentation
Coming soon...
Examples
context.command
/** ... */const bot = ;bot; bot { if contextcommandname == 'hello' return contextchat; };
Events
/** ... */const bot = ;bot; /** Listen of all commands */bot; /** Listens only a given command */bot;/** ... */
Method
command
for the instance
/** ... */const bot = ;bot; bot { if contextcommandname == 'source' contextchat; } /** ... */
Method
command
for the custom helpers
/** ... */const bot = ;bot; bot;/** ... */