Reformulation of bot structure
This commit is contained in:
parent
4b9ed6d2c0
commit
2f65126319
15 changed files with 2 additions and 2 deletions
22
commands/gay.js
Normal file
22
commands/gay.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
module.exports = function(bot, msg) {
|
||||
const chatId = msg.chat.id;
|
||||
const userName = msg.from.first_name;
|
||||
let isGay = "";
|
||||
|
||||
function getRandomInt(max) {
|
||||
return Math.floor(Math.random() * max);
|
||||
}
|
||||
|
||||
const randomValue = getRandomInt(2);
|
||||
|
||||
if (randomValue === 0) {
|
||||
isGay = `*You (${userName}) are not gay.*`;
|
||||
} else {
|
||||
isGay = `*Yes, you (${userName}) are gay.*`;
|
||||
}
|
||||
|
||||
const message = `${isGay}`;
|
||||
|
||||
bot.sendMessage(chatId, message, { parse_mode: 'Markdown' })
|
||||
.catch(error => console.error('WARN: Message cannot be sent: ', error));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue