diff options
Diffstat (limited to 'lib/extensions/discord.js/ExtendedUser.ts')
-rw-r--r-- | lib/extensions/discord.js/ExtendedUser.ts | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/lib/extensions/discord.js/ExtendedUser.ts b/lib/extensions/discord.js/ExtendedUser.ts index 65b14c7..7846a70 100644 --- a/lib/extensions/discord.js/ExtendedUser.ts +++ b/lib/extensions/discord.js/ExtendedUser.ts @@ -1,32 +1,28 @@ import { User } from 'discord.js'; +import type { TanzaniteClient } from '../discord-akairo/TanzaniteClient.js'; + +interface Extension { + /** + * Indicates whether the user is an owner of the bot. + */ + isOwner(): boolean; + /** + * Indicates whether the user is a superuser of the bot. + */ + isSuperUser(): boolean; +} declare module 'discord.js' { - export interface User { - /** - * Indicates whether the user is an owner of the bot. - */ - isOwner(): boolean; - /** - * Indicates whether the user is a superuser of the bot. - */ - isSuperUser(): boolean; + export interface User extends Extension { + readonly client: TanzaniteClient; } } -/** - * Represents a user on Discord. - */ -export class ExtendedUser extends User { - /** - * Indicates whether the user is an owner of the bot. - */ +export class ExtendedUser extends User implements Extension { public override isOwner(): boolean { return this.client.isOwner(this); } - /** - * Indicates whether the user is a superuser of the bot. - */ public override isSuperUser(): boolean { return this.client.isSuperUser(this); } |