3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-25 10:25:01 +00:00

Implement temporary permission check public functions

This commit is contained in:
Dark 2021-08-15 01:44:25 +02:00
parent f6f9bfedf4
commit 04cd1fc0e7
7 changed files with 46 additions and 10 deletions

View 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];
}