From c0885f929a919e856a7a24c3d8cc37880479006f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 28 Mar 2020 03:06:21 +0200 Subject: [PATCH] Fixed bug that came from previous commit --- events/msg.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/events/msg.js b/events/msg.js index e0a8a5d..f4bda61 100644 --- a/events/msg.js +++ b/events/msg.js @@ -3,7 +3,11 @@ module.exports = { async execute(client, msg, Discord) { if (msg.author.bot || !msg.guild) return; let prefix = client.config.prefix; - if(msg.mentions.members.first().user.id === client.user.id){ prefix = "<@!" + client.user.id + "> "; } + if(msg.mentions.members.first()){ + if(msg.mentions.members.first().user.id === client.user.id){ + prefix = "<@!" + client.user.id + "> "; + } + } const args = msg.content.slice(prefix.length).split(' '); if (!msg.content.startsWith(prefix)) return; if (!args[0]) return;