Convert everything to superagent properly

This commit is contained in:
Daniel Odendahl Jr
2018-06-08 15:36:21 +00:00
parent 63f3398858
commit b4c815f403
17 changed files with 163 additions and 155 deletions
+1 -2
View File
@@ -35,7 +35,7 @@ module.exports = class OsuSignatureCommand extends Command {
async run(msg, { user, color }) {
try {
const { body, text } = await request
const { body } = await request
.get('https://lemmmy.pw/osusig/sig.php')
.query({
colour: color,
@@ -48,7 +48,6 @@ module.exports = class OsuSignatureCommand extends Command {
onlineindicator: '',
xpbar: ''
});
if (text.includes('<b>Warning</b>')) return msg.say('Could not find any results.');
return msg.say({ files: [{ attachment: body, name: 'osu-signature.png' }] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);