From 68b32fc287517895735f292c906640f22e78c302 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Mon, 27 Apr 2020 17:03:36 +0200 Subject: [PATCH] Make it work in dm too --- commands/general/tweet.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/general/tweet.js b/commands/general/tweet.js index ad508d93..3d55d344 100644 --- a/commands/general/tweet.js +++ b/commands/general/tweet.js @@ -172,9 +172,10 @@ class tweetCommand extends Command { .addField('Link', `https://twitter.com/i/status/${tweetid}`, true) .addField('Tweet ID', tweetid, true) .addField('Author', `${message.author.username} (${message.author.id})`, true) - .addField('Guild', `${message.guild.name} (${message.guild.id})`, true) .setTimestamp(); + if (message.guild) Embed.addField('Guild', `${message.guild.name} (${message.guild.id})`, true); + if (Attachment[0]) Embed.setImage(Attachment[0].url); channel = client.channels.resolve(twiChannel);