mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 13:55:03 +00:00
fix: occasional crash in context menus
Co-authored-by: metal <metal@i0.tf>
This commit is contained in:
parent
3064a05b4d
commit
dd2eebd4a5
3 changed files with 8 additions and 8 deletions
|
@ -10,7 +10,7 @@ export async function cleanAction(
|
|||
amount: number,
|
||||
interaction: ContextMenuCommandInteraction,
|
||||
) {
|
||||
interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
const executingMember = await pluginData.guild.members.fetch(interaction.user.id);
|
||||
const userCfg = await pluginData.config.getMatchingConfig({
|
||||
channelId: interaction.channelId,
|
||||
|
@ -34,10 +34,10 @@ export async function cleanAction(
|
|||
const user = undefined;
|
||||
|
||||
try {
|
||||
interaction.followUp(`Cleaning... Amount: ${amount}, User Only: ${targetUserOnly}, Pins: ${deletePins}`);
|
||||
await interaction.followUp(`Cleaning... Amount: ${amount}, User Only: ${targetUserOnly}, Pins: ${deletePins}`);
|
||||
utility.clean({ count: amount, user, channel: targetMessage.channel.id, "delete-pins": deletePins }, targetMessage);
|
||||
} catch (e) {
|
||||
interaction.followUp({ ephemeral: true, content: "Plugin error, please check your BOT_ALERTs" });
|
||||
await interaction.followUp({ ephemeral: true, content: "Plugin error, please check your BOT_ALERTs" });
|
||||
|
||||
if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) {
|
||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue