From d835cdaebb6515c11e9566f7d1df84a4cae800b4 Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Sat, 30 Jan 2021 23:25:00 -0600 Subject: [PATCH] Check for mentioned user --- commands/kiss.js | 22 +++++++++++++++++++++- commands/leskiss.js | 22 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/commands/kiss.js b/commands/kiss.js index 6796d38..37c49c6 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -5,6 +5,8 @@ module.exports = { execute(client, message, args) { const messageAuthor = message.author const taggedUser = message.mentions.users.first(); + + // -------------------------------------- const gifchoices = [ "https://thumbs.gfycat.com/SlowGlossyBlackcrappie-small.gif", @@ -17,9 +19,27 @@ module.exports = { const index = Math.floor(Math.random() * (gifchoices.length - 1) + 1); var gif = (gifchoices[index]); // --------------------------------------- + const errorembed = { + "title": "<:NyabotError:697145462347661412> Error", + "color": 13632027, + "footer": { + "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" + }, + "fields": [ + { + "name": "Well that happened...", + "value": "You need to @mention an user!" + } + ] + }; + + if(!taggedUser) { + return message.channel.send({ embed: errorembed}); + } const embed = { "title": ":heart: Kiss", - "description": "<@" + taggedUser + ">" + " You have been kissed by <@" + messageAuthor + ">!", + "description": "<@" + taggedUser + ">" + ", You have been kissed by <@" + messageAuthor + ">!", "color": 8311585, "footer": { "icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", diff --git a/commands/leskiss.js b/commands/leskiss.js index d803185..2476a3c 100644 --- a/commands/leskiss.js +++ b/commands/leskiss.js @@ -6,7 +6,7 @@ module.exports = { name: "leskiss", description: "Lesbian kiss <:lesbian:803831629428686849>", execute(client, message, args) { - const messageAuthor = message.messageAuthor + const messageAuthor = message.author const taggedUser = message.mentions.users.first(); // -------------------------------------- const gifchoices = [ @@ -30,6 +30,26 @@ module.exports = { const index = Math.floor(Math.random() * (gifchoices.length - 1) + 1); var gif = (gifchoices[index]); // --------------------------------------- + const errorembed = { + "title": "<:NyabotError:697145462347661412> Error", + "color": 13632027, + "footer": { + "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" + }, + "fields": [ + { + "name": "Well that happened...", + "value": "You need to @mention an user!" + } + ] + }; + + if(!taggedUser) { + return message.channel.send({ embed: errorembed}); + // Checks if a user was mentioned. If not, returns error message. + } + const embed = { "title": ":heart: <:lesbian:803831629428686849> Kiss",