Skip to content

Commit 66b32d1

Browse files
alexemanuelolauuruum
authored andcommitted
Fix thumbnails only allowing urls
1 parent 4a914bd commit 66b32d1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/discordTools/discordEmbeds.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ module.exports = {
3838
if (options.hasOwnProperty('title')) embed.setTitle(options.title);
3939
if (options.hasOwnProperty('color')) embed.setColor(options.color);
4040
if (options.hasOwnProperty('description')) embed.setDescription(options.description);
41-
if (options.hasOwnProperty('thumbnail') && options.thumbnail !== '' && isValidUrl(options.thumbnail))
42-
embed.setThumbnail(options.thumbnail);
41+
if (options.hasOwnProperty('thumbnail') && options.thumbnail !== '') embed.setThumbnail(options.thumbnail);
4342
if (options.hasOwnProperty('image')) embed.setImage(options.image);
4443
if (options.hasOwnProperty('url') && options.url !== '') embed.setURL(options.url);
4544
if (options.hasOwnProperty('author')) embed.setAuthor(options.author);
@@ -603,7 +602,7 @@ module.exports = {
603602
footer: { text: body.name },
604603
title: data.title,
605604
description: data.message,
606-
thumbnail: body.img !== '' ? body.img : 'attachment://rocket.png'
605+
thumbnail: (body.img !== '' && isValidUrl(body.img)) ? body.img : 'attachment://rocket.png'
607606
});
608607
},
609608

0 commit comments

Comments
 (0)