mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 01:53:51 +02:00
Tweet doesn't handle errors very well
This commit is contained in:
@@ -194,8 +194,7 @@ module.exports = class TweetCommand extends Command {
|
|||||||
ctx.clip();
|
ctx.clip();
|
||||||
}
|
}
|
||||||
ctx.drawImage(avatar, 17, 84, 52, 52);
|
ctx.drawImage(avatar, 17, 84, 52, 52);
|
||||||
const errMsg = userData.err ? `_An error occurred fetching profile: \`${userData.err.message}\`_` : undefined;
|
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] });
|
||||||
return msg.say(errMsg, { files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fillTextWithEmoji(ctx, text, x, y, maxLineLen, emojiSize) {
|
async fillTextWithEmoji(ctx, text, x, y, maxLineLen, emojiSize) {
|
||||||
@@ -247,8 +246,7 @@ module.exports = class TweetCommand extends Command {
|
|||||||
avatar: avatarRes.body,
|
avatar: avatarRes.body,
|
||||||
avatarShape: data.user.profileImageShape,
|
avatarShape: data.user.profileImageShape,
|
||||||
checkType,
|
checkType,
|
||||||
followers: body.followersCount,
|
followers: body.followersCount
|
||||||
err: undefined
|
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const defaultPfp = await readFile(path.join(__dirname, '..', '..', 'assets', 'images', 'tweet', 'default.png'));
|
const defaultPfp = await readFile(path.join(__dirname, '..', '..', 'assets', 'images', 'tweet', 'default.png'));
|
||||||
|
|||||||
Reference in New Issue
Block a user