mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 22:05:01 +00:00
feat: first batch of emojis 🎉
This commit is contained in:
parent
dfb0e2c19d
commit
a4c4b17a14
91 changed files with 3659 additions and 2032 deletions
|
@ -1,56 +0,0 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveMember, resolveUser } from "../../../utils";
|
||||
import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd";
|
||||
import { modActionsMsgCmd } from "../types";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
};
|
||||
|
||||
export const ForceUnmuteCmd = modActionsMsgCmd({
|
||||
trigger: "forceunmute",
|
||||
permission: "can_mute",
|
||||
description: "Force-unmute the specified user, even if they're not on the server",
|
||||
|
||||
signature: [
|
||||
{
|
||||
user: ct.string(),
|
||||
time: ct.delay(),
|
||||
reason: ct.string({ required: false, catchAll: true }),
|
||||
|
||||
...opts,
|
||||
},
|
||||
{
|
||||
user: ct.string(),
|
||||
reason: ct.string({ required: false, catchAll: true }),
|
||||
|
||||
...opts,
|
||||
},
|
||||
],
|
||||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if they're muted in the first place
|
||||
if (!(await pluginData.state.mutes.isMuted(user.id))) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Cannot unmute: member is not muted");
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the server member to unmute
|
||||
const memberToUnmute = await resolveMember(pluginData.client, pluginData.guild, user.id);
|
||||
|
||||
// Make sure we're allowed to unmute this member
|
||||
if (memberToUnmute && !canActOn(pluginData, msg.member, memberToUnmute)) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Cannot unmute: insufficient permissions");
|
||||
return;
|
||||
}
|
||||
|
||||
actualUnmuteCmd(pluginData, user, msg, args);
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue