Push base Telegraf bot
This commit is contained in:
commit
05eddc7734
15 changed files with 818 additions and 0 deletions
18
commands/random.js
Normal file
18
commands/random.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
const Strings = require('../locales/english.json');
|
||||
|
||||
function getRandomInt(max) {
|
||||
return Math.floor(Math.random() * max);
|
||||
}
|
||||
|
||||
module.exports = (bot) => {
|
||||
bot.command('random', (ctx) => {
|
||||
const randomValue = getRandomInt(11);
|
||||
const randomVStr = Strings.randomNum.replace('{number}', randomValue);
|
||||
|
||||
ctx.reply(
|
||||
randomVStr, {
|
||||
parse_mode: 'Markdown'
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue