formatting

This commit is contained in:
Nicolás Serna 2022-07-02 18:04:40 -03:00
parent 482893a9ea
commit c13d9b239f
2 changed files with 10 additions and 14 deletions

View File

@ -101,7 +101,7 @@ export class Member implements Model {
let url: string; let url: string;
if (this.user.bot) { if (this.user.bot) {
return this.user.avatarURL() return this.user.avatarURL();
} }
if (!this.avatarHash) { if (!this.avatarHash) {
@ -110,7 +110,7 @@ export class Member implements Model {
url = Routes.USER_AVATAR(this.user.id, iconBigintToHash(this.avatarHash)); url = Routes.USER_AVATAR(this.user.id, iconBigintToHash(this.avatarHash));
} }
return formatImageURL(url, options.size, options.format) return formatImageURL(url, options.size, options.format);
} }
toString() { toString() {

View File

@ -1,21 +1,17 @@
import type { import type { DiscordEmbed, DiscordEmbedField, DiscordEmbedProvider } from "../../vendor/external.ts";
DiscordEmbedField,
DiscordEmbed,
DiscordEmbedProvider
} from '../../vendor/external.ts';
export interface EmbedFooter { export interface EmbedFooter {
text: string; text: string;
iconUrl?: string; iconUrl?: string;
proxyIconUrl?: string proxyIconUrl?: string;
} }
export interface EmbedAuthor { export interface EmbedAuthor {
name: string name: string;
text?: string; text?: string;
url?: string; url?: string;
iconUrl?: string; iconUrl?: string;
proxyIconUrl?: string proxyIconUrl?: string;
} }
export interface EmbedVideo { export interface EmbedVideo {
@ -26,10 +22,10 @@ export interface EmbedVideo {
} }
export class EmbedBuilder { export class EmbedBuilder {
#data: DiscordEmbed #data: DiscordEmbed;
constructor(data: DiscordEmbed = {}) { constructor(data: DiscordEmbed = {}) {
this.#data = data; this.#data = data;
if (!this.#data.fields) this.#data.fields = [] if (!this.#data.fields) this.#data.fields = [];
} }
setAuthor(author: EmbedAuthor) { setAuthor(author: EmbedAuthor) {
@ -37,7 +33,7 @@ export class EmbedBuilder {
name: author.name, name: author.name,
icon_url: author.iconUrl, icon_url: author.iconUrl,
proxy_icon_url: author.proxyIconUrl, proxy_icon_url: author.proxyIconUrl,
url: author.url url: author.url,
}; };
return this; return this;
} }
@ -102,7 +98,7 @@ export class EmbedBuilder {
height: video.height, height: video.height,
proxy_url: video.proxyUrl, proxy_url: video.proxyUrl,
url: video.url, url: video.url,
width: video.width width: video.width,
}; };
return this; return this;
} }