From 3aca11ebb34138d8d85032f112f83e5a84a0eaae Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Thu, 29 Jun 2023 14:00:08 +0500 Subject: [PATCH] oi --- events/CommandHandler.js | 2 +- events/MessageHandler.js | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/events/CommandHandler.js b/events/CommandHandler.js index 3879c59c..2c9224ae 100644 --- a/events/CommandHandler.js +++ b/events/CommandHandler.js @@ -25,7 +25,7 @@ class CommandHandler extends BaseEvent { const guildData = await client.findOrCreateGuild({ id: interaction.guildId }); const memberData = await client.findOrCreateMember({ id: interaction.member.id, guildId: interaction.guildId }); - data.guildData = guildData; + interaction.guild.data = data.guildData = guildData; data.memberData = memberData; } diff --git a/events/MessageHandler.js b/events/MessageHandler.js index 66073071..5fee2e78 100644 --- a/events/MessageHandler.js +++ b/events/MessageHandler.js @@ -22,19 +22,17 @@ class MessageCreate extends BaseEvent { const data = {}; if (message.author.bot) return; + if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) return message.replyT("misc:HELLO_SERVER", null, { mention: true }); const userData = await client.findOrCreateUser({ id: message.author.id }); data.userData = userData; if (message.guild && !message.member) await message.guild.members.fetch(message.author.id); if (message.guild) { - const guild = await client.findOrCreateGuild({ id: message.guild.id }); - data.guildData = guild; - } - - if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) return message.replyT("misc:HELLO_SERVER", null, { mention: true }); - if (message.guild) { + const guildData = await client.findOrCreateGuild({ id: message.guild.id }); const memberData = await client.findOrCreateMember({ id: message.author.id, guildId: message.guild.id }); + + message.guild.data = data.guildData = guildData; data.memberData = memberData; }