mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-27 05:01:02 +00:00
fix(bot-discord): fix "Thinking..."
you have thinked for too long my child
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -52,6 +52,6 @@ export default {
|
|||||||
actionBy: interaction.member,
|
actionBy: interaction.member,
|
||||||
channel: interaction.channel,
|
channel: interaction.channel,
|
||||||
expire: parsedDuration
|
expire: parsedDuration
|
||||||
});
|
}, interaction);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,6 +58,6 @@ export default {
|
|||||||
actionBy: interaction.member,
|
actionBy: interaction.member,
|
||||||
channel: interaction.channel,
|
channel: interaction.channel,
|
||||||
expire: parsedDuration
|
expire: parsedDuration
|
||||||
});
|
}, interaction);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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] });
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user