TelegramBot/commands/fun.js
mthlma fd3196a34f
Update README.md + Translations (#6)
* Update README.md

Now we don't have config.env anymore, we now use config.json inside props folder

* Add portuguese.json

* Set portuguese language if  user's telegram app is in portuguese

* oh fudge, I forgot this one

---------

Co-authored-by: GiovaniFZ <giovanifinazzi@gmail.com>
2024-07-25 23:40:22 -03:00

52 lines
No EOL
1.2 KiB
JavaScript

const resources = require('../props/resources.json');
const { getStrings } = require('./checklang');
function furryFunction(ctx) {
const Strings = getStrings(ctx.from.language_code);
if (Math.random() < 0.5 ? "yes" : "no" === "yes") {
ctx.replyWithAnimation(
resources.furryGif, {
caption: Strings.isFurry,
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
}
);
} else {
ctx.reply(
Strings.isNtFurry, {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
}
);
}
}
function gayFunction(ctx) {
const Strings = getStrings(ctx.from.language_code);
if (Math.random() < 0.5 ? "yes" : "no" === "yes") {
ctx.replyWithAnimation(
resources.gayFlag, {
caption: Strings.isGay,
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
}
);
} else {
ctx.reply(
Strings.isNtGay, {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
}
);
}
}
module.exports = (bot) => {
bot.command('furry', (ctx) => {
furryFunction(ctx);
});
bot.command('gay', (ctx) => {
gayFunction(ctx);
});
};