mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 13:55:03 +00:00
feat: Context menu mod menu command
This commit is contained in:
parent
5a4e50b19d
commit
771ed76f64
17 changed files with 818 additions and 204 deletions
35
backend/src/plugins/ModActions/functions/hasModActionPerm.ts
Normal file
35
backend/src/plugins/ModActions/functions/hasModActionPerm.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
import { GuildMember, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
|
||||
export async function hasNotePermission(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
member: GuildMember,
|
||||
channelId: Snowflake,
|
||||
) {
|
||||
return (await pluginData.config.getMatchingConfig({ member, channelId })).can_note;
|
||||
}
|
||||
|
||||
export async function hasWarnPermission(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
member: GuildMember,
|
||||
channelId: Snowflake,
|
||||
) {
|
||||
return (await pluginData.config.getMatchingConfig({ member, channelId })).can_warn;
|
||||
}
|
||||
|
||||
export async function hasMutePermission(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
member: GuildMember,
|
||||
channelId: Snowflake,
|
||||
) {
|
||||
return (await pluginData.config.getMatchingConfig({ member, channelId })).can_mute;
|
||||
}
|
||||
|
||||
export async function hasBanPermission(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
member: GuildMember,
|
||||
channelId: Snowflake,
|
||||
) {
|
||||
return (await pluginData.config.getMatchingConfig({ member, channelId })).can_ban;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
import { GuildMember, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
|
||||
export async function hasMutePermission(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
member: GuildMember,
|
||||
channelId: Snowflake,
|
||||
) {
|
||||
return (await pluginData.config.getMatchingConfig({ member, channelId })).can_mute;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue