attempt to fix RichEmbed
parent
c1975d6a91
commit
a859352f39
|
@ -105,8 +105,8 @@ export default class RichEmbed {
|
||||||
*/
|
*/
|
||||||
setAuthor(name: string, icon_url?: string, url?: string) {
|
setAuthor(name: string, icon_url?: string, url?: string) {
|
||||||
if (typeof name !== 'string') throw new TypeError('RichEmbed Author names must be a string.');
|
if (typeof name !== 'string') throw new TypeError('RichEmbed Author names must be a string.');
|
||||||
if (typeof url !== 'string') throw new TypeError('RichEmbed Author URLs must be a string.');
|
if (url && typeof url !== 'string') throw new TypeError('RichEmbed Author URLs must be a string.');
|
||||||
if (typeof icon_url !== 'string') throw new TypeError('RichEmbed Author icons must be a string.');
|
if (icon_url && typeof icon_url !== 'string') throw new TypeError('RichEmbed Author icons must be a string.');
|
||||||
if (!url.startsWith('http://') || !url.startsWith('https://')) url = `https://${url}`;
|
if (!url.startsWith('http://') || !url.startsWith('https://')) url = `https://${url}`;
|
||||||
if (!icon_url.startsWith('http://') || !icon_url.startsWith('https://')) icon_url = `https://${icon_url}`;
|
if (!icon_url.startsWith('http://') || !icon_url.startsWith('https://')) icon_url = `https://${icon_url}`;
|
||||||
this.author = { name, icon_url, url };
|
this.author = { name, icon_url, url };
|
||||||
|
|
Loading…
Reference in New Issue