mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-08 03:27:20 +00:00
Used guildPluginSlashCommand instead of raw blueprints
This commit is contained in:
parent
7eff7bcaa6
commit
cbec6101e0
27 changed files with 168 additions and 121 deletions
|
@ -1,9 +1,11 @@
|
|||
import { GuildMember } from "discord.js";
|
||||
import { slashOptions } from "knub";
|
||||
import { hasPermission } from "../../../../pluginUtils";
|
||||
import { convertDelayStringToMS } from "../../../../utils";
|
||||
import { convertDelayStringToMS, resolveMember } from "../../../../utils";
|
||||
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
|
||||
import { CommonPlugin } from "../../../Common/CommonPlugin";
|
||||
import { actualUnmuteCmd } from "../../functions/actualCommands/actualUnmuteCmd";
|
||||
import { modActionsSlashCmd } from "../../types";
|
||||
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
|
||||
|
||||
const opts = [
|
||||
|
@ -16,7 +18,7 @@ const opts = [
|
|||
}),
|
||||
];
|
||||
|
||||
export const ForceUnmuteSlashCmd = {
|
||||
export const ForceUnmuteSlashCmd = modActionsSlashCmd({
|
||||
name: "forceunmute",
|
||||
configPermission: "can_mute",
|
||||
description: "Force-unmute the specified user, even if they're not on the server",
|
||||
|
@ -36,7 +38,7 @@ export const ForceUnmuteSlashCmd = {
|
|||
return;
|
||||
}
|
||||
|
||||
let mod = interaction.member;
|
||||
let mod = interaction.member as GuildMember;
|
||||
let ppId: string | undefined;
|
||||
const canActAsOther = await hasPermission(pluginData, "can_act_as_other", {
|
||||
channel: interaction.channel,
|
||||
|
@ -51,7 +53,7 @@ export const ForceUnmuteSlashCmd = {
|
|||
return;
|
||||
}
|
||||
|
||||
mod = options.mod;
|
||||
mod = (await resolveMember(pluginData.client, pluginData.guild, options.mod.id))!;
|
||||
ppId = interaction.user.id;
|
||||
}
|
||||
|
||||
|
@ -61,6 +63,6 @@ export const ForceUnmuteSlashCmd = {
|
|||
return;
|
||||
}
|
||||
|
||||
actualUnmuteCmd(pluginData, interaction, options.user, attachments, mod, ppId, convertedTime, options.reason);
|
||||
actualUnmuteCmd(pluginData, interaction, options.user, attachments, mod, ppId, convertedTime, options.reason ?? "");
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue