mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Implement temporary permission check public functions
This commit is contained in:
parent
7cf75f3255
commit
1c8a223264
7 changed files with 46 additions and 10 deletions
12
backend/src/plugins/Utility/functions/hasPermission.ts
Normal file
12
backend/src/plugins/Utility/functions/hasPermission.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { GuildMember, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { UtilityPluginType } from "../types";
|
||||
|
||||
export async function hasPermission(
|
||||
pluginData: GuildPluginData<UtilityPluginType>,
|
||||
member: GuildMember,
|
||||
channelId: Snowflake,
|
||||
permission: string,
|
||||
) {
|
||||
return (await pluginData.config.getMatchingConfig({ member, channelId }))[permission];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue