From 34d61f77f965cde281e8cd3cac549f66b301e702 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 12 May 2017 20:29:36 +0000 Subject: [PATCH] Fix that --- commands/numedit/currency.js | 3 ++- commands/random/spam.js | 3 +++ commands/randomimg/cat.js | 3 +++ commands/randomimg/dog.js | 3 +++ commands/randomimg/xiaopai.js | 3 +++ commands/search/soundcloud.js | 3 ++- 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/commands/numedit/currency.js b/commands/numedit/currency.js index 2ec4dfe4..71377c00 100644 --- a/commands/numedit/currency.js +++ b/commands/numedit/currency.js @@ -44,7 +44,8 @@ module.exports = class CurrencyCommand extends Command { const { base, to, amount } = args; if (base === to) return msg.say(`Converting ${base} to ${to} is the same value, dummy.`); try { - const { body } = await request.get(`http://api.fixer.io/latest?base=${base}&symbols=${to}`); + const { body } = await request + .get(`http://api.fixer.io/latest?base=${base}&symbols=${to}`); const rate = body.rates[to]; return msg.say(`${amount} ${base} is ${amount * rate} ${to}.`); } catch (err) { diff --git a/commands/random/spam.js b/commands/random/spam.js index 3e382f0d..270f0b95 100644 --- a/commands/random/spam.js +++ b/commands/random/spam.js @@ -11,6 +11,9 @@ module.exports = class SpamCommand extends Command { } run(msg) { + if (msg.channel.type !== 'dm') + if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) + return msg.say('This Command requires the `Attach Files` Permission.'); return msg.channel.send({ files: ['https://i.imgur.com/2JFu5xE.jpg'] }) .catch(err => msg.say(err)); } diff --git a/commands/randomimg/cat.js b/commands/randomimg/cat.js index 104ef490..b11564a0 100644 --- a/commands/randomimg/cat.js +++ b/commands/randomimg/cat.js @@ -13,6 +13,9 @@ module.exports = class CatCommand extends Command { } async run(msg) { + if (msg.channel.type !== 'dm') + if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) + return msg.say('This Command requires the `Attach Files` Permission.'); try { const { body } = await request .get('http://random.cat/meow'); diff --git a/commands/randomimg/dog.js b/commands/randomimg/dog.js index 6c31e634..8ef25dea 100644 --- a/commands/randomimg/dog.js +++ b/commands/randomimg/dog.js @@ -12,6 +12,9 @@ module.exports = class DogCommand extends Command { } async run(msg) { + if (msg.channel.type !== 'dm') + if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) + return msg.say('This Command requires the `Attach Files` Permission.'); try { const { body } = await request .get('https://random.dog/woof.json'); diff --git a/commands/randomimg/xiaopai.js b/commands/randomimg/xiaopai.js index 3a21d6b5..72418fd9 100644 --- a/commands/randomimg/xiaopai.js +++ b/commands/randomimg/xiaopai.js @@ -13,6 +13,9 @@ module.exports = class XiaoCommand extends Command { } run(msg) { + if (msg.channel.type !== 'dm') + if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) + return msg.say('This Command requires the `Attach Files` Permission.'); const xiao = xiaos[Math.floor(Math.random() * xiaos.length)]; return msg.channel.send({ files: [xiao] }) .catch(err => msg.say(err)); diff --git a/commands/search/soundcloud.js b/commands/search/soundcloud.js index 52d97343..0ae68b23 100644 --- a/commands/search/soundcloud.js +++ b/commands/search/soundcloud.js @@ -32,7 +32,8 @@ module.exports = class SoundCloudCommand extends Command { if (!body.length) throw new Error('No Results.'); const embed = new RichEmbed() .setColor(0xF15A22) - .setAuthor(body[0].title) + .setAuthor('SoundCloud') + .setTitle(body[0].title) .setURL(body[0].permalink_url) .setThumbnail(body[0].artwork_url) .addField('**Artist:**',