Fixes #7
parent
817328a49d
commit
ef31fc3abc
|
@ -87,7 +87,7 @@ export default class RichEmbed implements EmbedData {
|
||||||
*/
|
*/
|
||||||
setURL(url: string) {
|
setURL(url: string) {
|
||||||
if (typeof url !== 'string') throw new TypeError('RichEmbed URLs must be a string.');
|
if (typeof url !== 'string') throw new TypeError('RichEmbed URLs must be a string.');
|
||||||
if (!url.startsWith('http://') || !url.startsWith('https://')) url = `https://${url}`;
|
if (!url.startsWith('http://') && !url.startsWith('https://')) url = `https://${url}`;
|
||||||
this.url = encodeURI(url);
|
this.url = encodeURI(url);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue