2024-05-31 17:40:29 -03:00
|
|
|
module.exports = function(bot, msg) {
|
|
|
|
const chatId = msg.chat.id;
|
|
|
|
const userName = msg.from.first_name;
|
|
|
|
const userId = msg.from.id;
|
|
|
|
let isFurry = "";
|
|
|
|
|
|
|
|
function getRandomInt(max) {
|
|
|
|
return Math.floor(Math.random() * max);
|
2024-06-01 19:21:30 -03:00
|
|
|
};
|
2024-05-31 17:40:29 -03:00
|
|
|
|
|
|
|
const randomValue = getRandomInt(2);
|
|
|
|
|
|
|
|
if (randomValue === 0) {
|
2024-05-31 17:55:09 -03:00
|
|
|
isFurry = `You (${userName}) are not a furry.`;
|
2024-05-31 17:40:29 -03:00
|
|
|
} else {
|
2024-05-31 17:55:09 -03:00
|
|
|
isFurry = `Yes, you (${userName}) are a furry.`;
|
2024-05-31 17:47:31 -03:00
|
|
|
};
|
2024-05-31 17:40:29 -03:00
|
|
|
|
|
|
|
const message = `${isFurry}`;
|
|
|
|
|
|
|
|
bot.sendMessage(chatId, message)
|
|
|
|
.catch(error => console.error('ERROR: Message cannot be sent:', error));
|
|
|
|
console.log(`INFO: /furry executed by ${userName}, ${userId}`)
|
|
|
|
}
|