/[sudobot]/branches/6.x/src/utils/AbstractPermissionManager.ts
ViewVC logotype

Contents of /branches/6.x/src/utils/AbstractPermissionManager.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 577 - (show annotations)
Mon Jul 29 18:52:37 2024 UTC (8 months ago) by rakinar2
File MIME type: application/typescript
File size: 946 byte(s)
chore: add old version archive branches (2.x to 9.x-dev)
1 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 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26