Unnecessary split code removed + update swlib commit

Signed-off-by: lucmsilva651 <lucmsilva651@gmail.com>
This commit is contained in:
lucmsilva651 2024-08-31 21:23:30 -03:00
parent 96f915838d
commit 4be9aa4aca
No known key found for this signature in database
GPG key ID: D9B075FC6DC93985
9 changed files with 52 additions and 60 deletions

View file

@ -45,7 +45,24 @@ async function handleDiceCommand(ctx, emoji, delay) {
}, delay);
}
function getRandomInt(max) {
return Math.floor(Math.random() * max);
}
module.exports = (bot) => {
bot.command('random', spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
const randomValue = getRandomInt(11);
const randomVStr = Strings.randomNum.replace('{number}', randomValue);
ctx.reply(
randomVStr, {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
}
);
});
bot.command('dice', spamwatchMiddleware, async (ctx) => {
await handleDiceCommand(ctx, undefined, 4000);
});
@ -58,6 +75,14 @@ module.exports = (bot) => {
await handleDiceCommand(ctx, '⚽', 3000);
});
bot.command('dart', spamwatchMiddleware, async (ctx) => {
await handleDiceCommand(ctx, '🎯', 3000);
});
bot.command('bowling', spamwatchMiddleware, async (ctx) => {
await handleDiceCommand(ctx, '🎳', 3000);
});
bot.command('idice', spamwatchMiddleware, async (ctx) => {
const stickerId = "CAACAgQAAxkBAAJxjWbSSP-8ZNEhEpAJjQsHsGf-UuEPAAJCAAPI-uwTAAEBVWWh4ucINQQ";
ctx.replyWithSticker(stickerId, {

View file

@ -1,17 +0,0 @@
const { getStrings } = require('../plugins/checklang.js');
const resources = require('../props/resources.json');
const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js');
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
module.exports = (bot) => {
bot.help(spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
ctx.replyWithPhoto(
resources.lunaCat2, {
caption: Strings.lynxHelp,
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
}
);
});
};

View file

@ -14,4 +14,26 @@ module.exports = (bot) => {
}
);
});
bot.help(spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
ctx.replyWithPhoto(
resources.lunaCat2, {
caption: Strings.lynxHelp,
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
}
);
});
bot.command('privacy', spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
ctx.reply(
Strings.lynxPrivacy, {
parse_mode: 'Markdown',
disable_web_page_preview: true,
reply_to_message_id: ctx.message.message_id
}
);
});
};

View file

@ -1,16 +0,0 @@
const { getStrings } = require('../plugins/checklang.js');
const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js');
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
module.exports = (bot) => {
bot.command('privacy', spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
ctx.reply(
Strings.lynxPrivacy, {
parse_mode: 'Markdown',
disable_web_page_preview: true,
reply_to_message_id: ctx.message.message_id
}
);
});
};

View file

@ -1,22 +0,0 @@
const { getStrings } = require('../plugins/checklang.js');
const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js');
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
function getRandomInt(max) {
return Math.floor(Math.random() * max);
}
module.exports = (bot) => {
bot.command('random', spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
const randomValue = getRandomInt(11);
const randomVStr = Strings.randomNum.replace('{number}', randomValue);
ctx.reply(
randomVStr, {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
}
);
});
};