This commit is contained in:
Jonny_Bro (Nikita) 2023-06-29 14:00:08 +05:00
parent 7174722160
commit 3aca11ebb3
2 changed files with 5 additions and 7 deletions

View file

@ -25,7 +25,7 @@ class CommandHandler extends BaseEvent {
const guildData = await client.findOrCreateGuild({ id: interaction.guildId }); const guildData = await client.findOrCreateGuild({ id: interaction.guildId });
const memberData = await client.findOrCreateMember({ id: interaction.member.id, guildId: 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; data.memberData = memberData;
} }

View file

@ -22,19 +22,17 @@ class MessageCreate extends BaseEvent {
const data = {}; const data = {};
if (message.author.bot) return; 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 }); const userData = await client.findOrCreateUser({ id: message.author.id });
data.userData = userData; data.userData = userData;
if (message.guild && !message.member) await message.guild.members.fetch(message.author.id); if (message.guild && !message.member) await message.guild.members.fetch(message.author.id);
if (message.guild) { if (message.guild) {
const guild = await client.findOrCreateGuild({ id: message.guild.id }); const guildData = 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 memberData = await client.findOrCreateMember({ id: message.author.id, guildId: 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; data.memberData = memberData;
} }