mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 13:55:03 +00:00
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
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;
|
|
}
|