diff --git a/src/commands/applications/chat.ts b/src/commands/applications/chat.ts index 729b85c..ede6928 100644 --- a/src/commands/applications/chat.ts +++ b/src/commands/applications/chat.ts @@ -107,7 +107,7 @@ class BaseCommand { __filePath?: string; __t?: { name: string | undefined; description: string | undefined }; - __d?: true; + __autoload?: true; __tGroups?: Record< string /* name for group*/, { diff --git a/src/commands/decorators.ts b/src/commands/decorators.ts index 2241a24..2a683e7 100644 --- a/src/commands/decorators.ts +++ b/src/commands/decorators.ts @@ -126,7 +126,7 @@ export function Options(options: (new () => SubCommand)[] | OptionsRecord) { export function AutoLoad() { return (target: T) => class extends target { - __d = true; + __autoload = true; }; } diff --git a/src/commands/handler.ts b/src/commands/handler.ts index 8ca0b8b..3e5e87b 100644 --- a/src/commands/handler.ts +++ b/src/commands/handler.ts @@ -76,7 +76,7 @@ export class CommandHandler extends BaseHandler { } commandInstance.__filePath = command.path; commandInstance.options ??= [] as NonNullable; - if (commandInstance.__d) { + if (commandInstance.__autoload) { //@AutoLoad const options = await this.getFiles(dirname(command.path)); for (const option of options) { diff --git a/src/structures/GuildMember.ts b/src/structures/GuildMember.ts index 67a5ea5..684bcf9 100644 --- a/src/structures/GuildMember.ts +++ b/src/structures/GuildMember.ts @@ -188,6 +188,10 @@ export class GuildMember extends BaseGuildMember { return this.rest.cdn.guildMemberAvatar(this.guildId, this.id, this.avatar, options); } + bannerURL(options?: ImageOptions) { + return this.user.bannerURL(options); + } + async fetchPermissions() { if ('permissions' in this) return this.permissions as PermissionsBitField; return this.roles.permissions(); diff --git a/src/structures/User.ts b/src/structures/User.ts index 4ca3fb6..6e3b624 100644 --- a/src/structures/User.ts +++ b/src/structures/User.ts @@ -38,6 +38,11 @@ export class User extends DiscordBase { return this.rest.cdn.avatar(this.id, this.avatar, options); } + bannerURL(options?: ImageOptions) { + if (!this.banner) return; + return this.rest.cdn.banner(this.id, this.banner, options); + } + presence() { return this.cache.presences?.get(this.id); }