kowalski/commands/random.js

19 lines
450 B
JavaScript
Raw Normal View History

2024-07-24 22:39:27 -03:00
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, {
2024-07-25 03:55:05 +00:00
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
2024-07-24 22:39:27 -03:00
}
);
});
};