fix(bot-discord): fix "Thinking..."

you have thinked for too long my child
This commit is contained in:
GramingFoxTeam
2023-08-10 17:22:59 +03:00
parent 19651c0fb1
commit 2deeb4f2b3
8 changed files with 11 additions and 11 deletions

View File

@@ -40,6 +40,6 @@ export default {
actionTo: await client.users.fetch(interaction.options.getString('user')), actionTo: await client.users.fetch(interaction.options.getString('user')),
actionBy: interaction.member, actionBy: interaction.member,
channel: interaction.channel channel: interaction.channel
}); }, interaction);
} }
}; };

View File

@@ -52,6 +52,6 @@ export default {
actionBy: interaction.member, actionBy: interaction.member,
channel: interaction.channel, channel: interaction.channel,
expire: parsedDuration expire: parsedDuration
}); }, interaction);
} }
}; };

View File

@@ -58,6 +58,6 @@ export default {
actionBy: interaction.member, actionBy: interaction.member,
channel: interaction.channel, channel: interaction.channel,
expire: parsedDuration expire: parsedDuration
}); }, interaction);
} }
}; };

View File

@@ -27,6 +27,6 @@ export default {
actionTo: await client.users.fetch(interaction.options.getString('user')), actionTo: await client.users.fetch(interaction.options.getString('user')),
actionBy: interaction.member, actionBy: interaction.member,
channel: interaction.channel channel: interaction.channel
}); }, interaction);
} }
}; };

View File

@@ -49,6 +49,6 @@ export default {
actionTo: await client.users.fetch(interaction.options.getString('user')), actionTo: await client.users.fetch(interaction.options.getString('user')),
actionBy: interaction.member, actionBy: interaction.member,
channel: interaction.channel, channel: interaction.channel,
}); }, interaction);
} }
}; };

View File

@@ -49,6 +49,6 @@ export default {
actionTo: await client.users.fetch(interaction.options.getString('user')), actionTo: await client.users.fetch(interaction.options.getString('user')),
actionBy: interaction.member, actionBy: interaction.member,
channel: interaction.channel, channel: interaction.channel,
}); }, interaction);
} }
}; };

View File

@@ -59,7 +59,7 @@ export default async function muteMember(config, member, { duration, reason, sup
// Remove the roles, give defined roles. // Remove the roles, give defined roles.
if (!existingMute) { if (!existingMute) {
const currentRoles = member.roles.map((role) => role.id); const currentRoles = member.roles.cache.map((role) => role.id);
let setRoles = []; let setRoles = [];
for (const role of currentRoles) { for (const role of currentRoles) {
if (takenRoles.includes(role)) continue; if (takenRoles.includes(role)) continue;
@@ -69,7 +69,7 @@ export default async function muteMember(config, member, { duration, reason, sup
setRoles = setRoles.concat(supportMute ? setRoles = setRoles.concat(supportMute ?
config.discord.mute.supportGiveRoles : config.discord.mute.supportGiveRoles :
config.discord.mute.giveRoles) config.discord.mute.giveRoles)
await member.roles.set(takenRoles); await member.roles.set(setRoles);
} }

View File

@@ -1,6 +1,6 @@
import { EmbedBuilder, messageLink } from 'discord.js'; import { EmbedBuilder, messageLink } from 'discord.js';
export default async function reportToLogs(config, client, action, message, { reason, expire, actionTo, actionBy }, msgChannel) { export default async function reportToLogs(config, client, action, message, { reason, expire, actionTo, actionBy }, interaction) {
const channel = await client.channels.fetch(config.logs.channelId); const channel = await client.channels.fetch(config.logs.channelId);
const thread = await channel.threads.fetch(config.logs.threadId); const thread = await channel.threads.fetch(config.logs.threadId);
@@ -31,8 +31,8 @@ export default async function reportToLogs(config, client, action, message, { re
actionEmbed.setFields(fields); actionEmbed.setFields(fields);
if (msgChannel) { if (interaction) {
const msg = await msgChannel.send({ embeds: [actionEmbed] }); const msg = await interaction.editReply({ embeds: [actionEmbed] });
reportToLogs(config, client, action, msg, { reason, expire, actionTo, actionBy }); reportToLogs(config, client, action, msg, { reason, expire, actionTo, actionBy });
} else thread.send({ embeds: [actionEmbed] }); } else thread.send({ embeds: [actionEmbed] });
} }