From 372d20046c29fa7c94b1f77c1cb3ed0809280437 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 26 Apr 2024 09:47:37 -0400 Subject: [PATCH] Tweet doesn't handle errors very well --- commands/edit-image-text/tweet.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commands/edit-image-text/tweet.js b/commands/edit-image-text/tweet.js index 66d02945..51a3e04c 100644 --- a/commands/edit-image-text/tweet.js +++ b/commands/edit-image-text/tweet.js @@ -194,8 +194,7 @@ module.exports = class TweetCommand extends Command { ctx.clip(); } ctx.drawImage(avatar, 17, 84, 52, 52); - const errMsg = userData.err ? `_An error occurred fetching profile: \`${userData.err.message}\`_` : undefined; - return msg.say(errMsg, { files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] }); } async fillTextWithEmoji(ctx, text, x, y, maxLineLen, emojiSize) { @@ -247,8 +246,7 @@ module.exports = class TweetCommand extends Command { avatar: avatarRes.body, avatarShape: data.user.profileImageShape, checkType, - followers: body.followersCount, - err: undefined + followers: body.followersCount }; } catch (err) { const defaultPfp = await readFile(path.join(__dirname, '..', '..', 'assets', 'images', 'tweet', 'default.png'));