1 |
rakinar2 |
577 |
import { Awaitable, GuildMember, PermissionResolvable } from "discord.js"; |
2 |
|
|
import Client from "../core/Client"; |
3 |
|
|
import { GetMemberPermissionInGuildResult } from "../services/PermissionManager"; |
4 |
|
|
|
5 |
|
|
export default abstract class AbstractPermissionManager { |
6 |
|
|
protected hasSyncedInitially = false; |
7 |
|
|
|
8 |
|
|
constructor(protected readonly client: Client) {} |
9 |
|
|
|
10 |
|
|
triggerSyncIfNeeded() { |
11 |
|
|
if (!this.hasSyncedInitially) { |
12 |
|
|
this.hasSyncedInitially = true; |
13 |
|
|
return this.sync?.(); |
14 |
|
|
} |
15 |
|
|
|
16 |
|
|
return null; |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
sync?(): Awaitable<void>; |
20 |
|
|
abstract shouldModerate(member: GuildMember, moderator: GuildMember): Awaitable<boolean>; |
21 |
|
|
abstract isImmuneToAutoMod( |
22 |
|
|
member: GuildMember, |
23 |
|
|
permission?: PermissionResolvable[] | PermissionResolvable |
24 |
|
|
): Awaitable<boolean>; |
25 |
|
|
abstract getMemberPermissions(member: GuildMember, mergeWithDiscordPermissions?: boolean): GetMemberPermissionInGuildResult; |
26 |
|
|
} |