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; }