Fixed spacing in gay

This commit is contained in:
Lucas Gabriel 2024-05-31 17:42:59 -03:00
parent 009881efc2
commit 78625caf24
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985

View File

@ -1,24 +1,24 @@
module.exports = function(bot, msg) { module.exports = function (bot, msg) {
const chatId = msg.chat.id; const chatId = msg.chat.id;
const userName = msg.from.first_name; const userName = msg.from.first_name;
const userId = msg.from.id; const userId = msg.from.id;
let isGay = ""; let isGay = "";
function getRandomInt(max) { function getRandomInt(max) {
return Math.floor(Math.random() * max); return Math.floor(Math.random() * max);
} }
const randomValue = getRandomInt(2); const randomValue = getRandomInt(2);
if (randomValue === 0) { if (randomValue === 0) {
isGay = `${userName} is not gay.`; isGay = `${userName} is not gay.`;
} else { } else {
isGay = `${userName} is a gay.`; isGay = `${userName} is a gay.`;
} }
const message = `${isGay}`; const message = `${isGay}`;
bot.sendMessage(chatId, message) bot.sendMessage(chatId, message)
.catch(error => console.error('ERROR: Message cannot be sent:', error)); .catch(error => console.error('ERROR: Message cannot be sent:', error));
console.log(`INFO: /gay executed by ${userName}, ${userId}`) console.log(`INFO: /gay executed by ${userName}, ${userId}`)
} }