This commit is contained in:
Daniel Odendahl Jr
2018-02-19 22:36:23 +00:00
parent 267d886bf9
commit a79ac8e5a5
+2 -1
View File
@@ -35,7 +35,7 @@ module.exports = class OsuSignatureCommand extends Command {
async run(msg, { user, color }) { async run(msg, { user, color }) {
try { try {
const { body } = await snekfetch const { body, text } = await snekfetch
.get('https://lemmmy.pw/osusig/sig.php') .get('https://lemmmy.pw/osusig/sig.php')
.query({ .query({
colour: color, colour: color,
@@ -48,6 +48,7 @@ module.exports = class OsuSignatureCommand extends Command {
onlineindicator: '', onlineindicator: '',
xpbar: '' xpbar: ''
}); });
if (text.startsWith('<br />\n<b>Warning</b>')) return msg.say('Could not find any results.');
return msg.say({ files: [{ attachment: body, name: 'osu-signature.png' }] }); return msg.say({ files: [{ attachment: body, name: 'osu-signature.png' }] });
} catch (err) { } catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);