feat: add hasPermission util to check if a member has a specific permission
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful

This commit is contained in:
SauceyRed 2025-08-07 06:32:04 +02:00
parent 695bdbc777
commit aecbcaefba
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7

11
utils/hasPermission.ts Normal file
View file

@ -0,0 +1,11 @@
import type { Permission } from "~/types/enums";
import type { GuildMemberResponse } from "~/types/interfaces";
export default (member: GuildMemberResponse, permission: Permission) => {
for (const role of member.roles) {
if (role.permissions & permission) {
return true;
}
}
return false;
}