More Stoof

This commit is contained in:
Daniel Odendahl Jr
2017-10-13 17:33:29 +00:00
parent 76111000b5
commit 981f59b1b1
40 changed files with 228 additions and 125 deletions
+10 -3
View File
@@ -27,9 +27,16 @@ module.exports = class AvatarCommand extends Command {
const format = user.avatar.startsWith('a_') ? 'gif' : 'png';
const avatarURL = user.avatarURL({
format,
size: 2048
size: 512
});
const { body } = await snekfetch.get(avatarURL);
return msg.say({ files: [{ attachment: body, name: `avatar.${format}` }] });
try {
const { body } = await snekfetch.get(avatarURL);
return msg.say({ files: [{
attachment: body,
name: `avatar.${format}`
}] });
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};