diff --git a/src/commands/customize.js b/src/commands/customize.js new file mode 100644 index 0000000..9cb9b16 --- /dev/null +++ b/src/commands/customize.js @@ -0,0 +1,24 @@ +module.exports = function(bot, msg) { + const chatId = msg.chat.id; + const userName = msg.from.first_name; + const userId = msg.from.id; + + const opts = { + reply_to_message_id: msg.message_id, + reply_markup: { + resize_keyboard: true, + one_time_keyboard: true, + keyboard: [ + [{text: 'He/Him'}], + [{text: 'She/Her'}], + [{text: 'They/Them'}], + ], + } + }; + + const message = "Select your pronouns:"; + + bot.sendMessage(chatId, message, opts,{ parse_mode: 'Markdown' }) + .catch(error => console.error('ERROR: Message cannot be sent:', error)); + console.log(`INFO: /customize executed by ${userName}, ${userId}`); +} diff --git a/src/commands/help.js b/src/commands/help.js index 13bab36..0c2ed51 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -7,12 +7,12 @@ module.exports = function(bot, msg) { const message = `*Hello! I'm Lynx!*\n\nI'm a simple bot made entirely from scratch in Node.js by Lucas Gabriel (lucmsilva).\n\n` + `I am running on a *GitHub Codespaces* server (see /stats), so please refrain from overusing or spamming the bot!\n\n` + `*Some commands to test*: - • */start*: start the bot - • */help*: send this message - • */whois*: send some information about yourself • */chatinfo*: send some information about the group • */furry*: check if you are a furry - • */gay*: check if you are gay\n\n` + + • */gay*: check if you are gay + • */help*: send this message + • */start*: start the bot + • */whois*: send some information about yourself\n\n` + `*See my source code in:* [GitHub Repository](https://github.com/lucmsilva651/lynx)\n\n` + `Thanks to all users, testers, contributors, and others. Without you, perhaps this bot wouldn't be possible ❤️`; diff --git a/src/commands/random.js b/src/commands/random.js new file mode 100644 index 0000000..5c8847b --- /dev/null +++ b/src/commands/random.js @@ -0,0 +1,18 @@ +module.exports = function(bot, msg) { + const chatId = msg.chat.id; + const userName = msg.from.first_name; + const userId = msg.from.id; + + function getRandomInt(max) { + return Math.floor(Math.random() * max); + } + + const randomValue = getRandomInt(11); + + const message = `*Generated value: ${randomValue}*`; + + bot.sendMessage(chatId, message, { parse_mode: 'Markdown' }) + .catch(error => console.error('ERROR: Message cannot be sent:', error)); + console.log(`INFO: /random executed by ${userName}, ${userId}`); + } + \ No newline at end of file