ts-discord-wrapper
Version:
A wrapper for the Discord API written in TypeScript
72 lines (60 loc) • 1.6 kB
text/typescript
export declare interface EmbedAuthor {
/**
* The text of the footer
*/
text : string;
/**
* The url of this author.
*/
url ?: string;
/**
* The icon url of the footer
*/
iconUrl ?: string;
/**
* The proxy icon url of the footer
*/
proxyIconUrl ?: string;
/**
* Converts this author to json
*/
toJson(): any;
}
export class EmbedAuthor {
text : string;
url ?: string;
iconUrl ?: string;
proxyIconUrl ?: string;
constructor(text : string, url ?: string, iconUrl ?: string, proxyIconUrl ?: string) {
this.text = text;
this.url = url;
this.iconUrl = iconUrl;
this.proxyIconUrl = proxyIconUrl;
}
public getText() : string {
return this.text;
}
public getUrl() : string | undefined {
return this.url;
}
public getIconUrl() : string | undefined {
return this.iconUrl;
}
public getProxyIconUrl() : string | undefined {
return this.proxyIconUrl;
}
public static fromJson(data : any) : EmbedAuthor {
return new EmbedAuthor(data.text,
data.url ? data.url : undefined,
data.icon_url ? data.icon_url : undefined,
data.proxy_icon_url ? data.proxy_icon_url : undefined);
}
public toJson() : any {
return {
text: this.text,
url: this.url,
icon_url: this.iconUrl,
proxy_icon_url: this.proxyIconUrl
};
}
}