mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
18 lines
397 B
JavaScript
18 lines
397 B
JavaScript
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'
|
|
}
|
|
);
|
|
});
|
|
}; |