Compare commits
No commits in common. "307969ffe59dbb752c2644ade400d65f6e678d51" and "76f77f7bfed610f00d79d26c30de72c3e59f891e" have entirely different histories.
307969ffe5
...
76f77f7bfe
3 changed files with 3 additions and 26 deletions
|
@ -1,11 +0,0 @@
|
|||
export const enum Permission {
|
||||
SendMessage = 1,
|
||||
ManageChannel = 2,
|
||||
ManageRole = 4,
|
||||
CreateInvite = 8,
|
||||
ManageInvite = 16,
|
||||
ManageGuild = 32,
|
||||
ManageMember = 64,
|
||||
BanMember = 128,
|
||||
KickMember = 256
|
||||
}
|
|
@ -19,17 +19,16 @@ export interface GuildResponse {
|
|||
description: string | null,
|
||||
icon: string | null,
|
||||
owner_uuid: string,
|
||||
roles: RoleResponse[],
|
||||
roles: [],
|
||||
member_count: number
|
||||
}
|
||||
|
||||
export interface GuildMemberResponse {
|
||||
uuid: string,
|
||||
nickname: string,
|
||||
user_uuid: string,
|
||||
guild_uuid: string,
|
||||
is_owner: boolean,
|
||||
user: UserResponse,
|
||||
roles: RoleResponse[]
|
||||
user: UserResponse
|
||||
}
|
||||
|
||||
export interface GuildMembersResponse {
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue