From 677bcce92a333bab3e21e433c5ef1abea60bf3a4 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Thu, 8 Jun 2023 12:31:06 +0500 Subject: [PATCH] fix quote generation --- events/MessageHandler.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/events/MessageHandler.js b/events/MessageHandler.js index b9950b5a..9ebebb16 100644 --- a/events/MessageHandler.js +++ b/events/MessageHandler.js @@ -48,8 +48,9 @@ class MessageCreate extends BaseEvent { await updateXp(client, message, data); if (message.content.includes("discord.com/channels/")) { - const ids = message.content.match(/\d+/g); - const channelId = ids[1], + const link = message.content.match(/(https|http):\/\/(discord.com)\/(channels)\/\d+\/\d+\/\d+/g)[0], + ids = link.match(/\d+/g), + channelId = ids[1], messageId = ids[2]; const msg = await client.channels.cache.get(channelId).messages.fetch(messageId);