2024-07-25 23:57:38 -03:00
|
|
|
const { getStrings } = require('../plugins/checklang.js');
|
2024-07-28 13:31:04 -03:00
|
|
|
const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js');
|
|
|
|
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
|
2024-07-24 22:39:27 -03:00
|
|
|
|
|
|
|
function getRandomInt(max) {
|
|
|
|
return Math.floor(Math.random() * max);
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = (bot) => {
|
2024-07-28 13:31:04 -03:00
|
|
|
bot.command('random', spamwatchMiddleware, async (ctx) => {
|
2024-07-25 23:40:22 -03:00
|
|
|
const Strings = getStrings(ctx.from.language_code);
|
2024-07-24 22:39:27 -03:00
|
|
|
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
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
};
|