mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 21:16:09 +00:00
feat: user#bannerURL
This commit is contained in:
parent
933bbe7d1b
commit
d119262f07
@ -107,7 +107,7 @@ class BaseCommand {
|
|||||||
|
|
||||||
__filePath?: string;
|
__filePath?: string;
|
||||||
__t?: { name: string | undefined; description: string | undefined };
|
__t?: { name: string | undefined; description: string | undefined };
|
||||||
__d?: true;
|
__autoload?: true;
|
||||||
__tGroups?: Record<
|
__tGroups?: Record<
|
||||||
string /* name for group*/,
|
string /* name for group*/,
|
||||||
{
|
{
|
||||||
|
@ -126,7 +126,7 @@ export function Options(options: (new () => SubCommand)[] | OptionsRecord) {
|
|||||||
export function AutoLoad() {
|
export function AutoLoad() {
|
||||||
return <T extends { new (...args: any[]): {} }>(target: T) =>
|
return <T extends { new (...args: any[]): {} }>(target: T) =>
|
||||||
class extends target {
|
class extends target {
|
||||||
__d = true;
|
__autoload = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ export class CommandHandler extends BaseHandler {
|
|||||||
}
|
}
|
||||||
commandInstance.__filePath = command.path;
|
commandInstance.__filePath = command.path;
|
||||||
commandInstance.options ??= [] as NonNullable<Command['options']>;
|
commandInstance.options ??= [] as NonNullable<Command['options']>;
|
||||||
if (commandInstance.__d) {
|
if (commandInstance.__autoload) {
|
||||||
//@AutoLoad
|
//@AutoLoad
|
||||||
const options = await this.getFiles(dirname(command.path));
|
const options = await this.getFiles(dirname(command.path));
|
||||||
for (const option of options) {
|
for (const option of options) {
|
||||||
|
@ -188,6 +188,10 @@ export class GuildMember extends BaseGuildMember {
|
|||||||
return this.rest.cdn.guildMemberAvatar(this.guildId, this.id, this.avatar, options);
|
return this.rest.cdn.guildMemberAvatar(this.guildId, this.id, this.avatar, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bannerURL(options?: ImageOptions) {
|
||||||
|
return this.user.bannerURL(options);
|
||||||
|
}
|
||||||
|
|
||||||
async fetchPermissions() {
|
async fetchPermissions() {
|
||||||
if ('permissions' in this) return this.permissions as PermissionsBitField;
|
if ('permissions' in this) return this.permissions as PermissionsBitField;
|
||||||
return this.roles.permissions();
|
return this.roles.permissions();
|
||||||
|
@ -38,6 +38,11 @@ export class User extends DiscordBase<APIUser> {
|
|||||||
return this.rest.cdn.avatar(this.id, this.avatar, options);
|
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() {
|
presence() {
|
||||||
return this.cache.presences?.get(this.id);
|
return this.cache.presences?.get(this.id);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user