Small changes, reply to some things

This commit is contained in:
Daniel Odendahl Jr
2017-10-24 19:02:27 +00:00
parent e0594c8749
commit c225ea4659
141 changed files with 251 additions and 254 deletions
+1 -3
View File
@@ -28,15 +28,13 @@ module.exports = class AnagramCommand extends Command {
async run(msg, { word, strict }) {
try {
const { body } = await snekfetch.get(`http://www.anagramica.com/best/${word}`);
if (!body.best.length) return msg.say('Could not find any results.');
const all = body.best.filter(anagram => anagram.toLowerCase() !== word);
if (!all.length) return msg.say('Could not find any results.');
const words = strict ? all.filter(anagram => anagram.length === word.length) : all;
if (!words.length) return msg.say('Could not find any results.');
return msg.say(words[Math.floor(Math.random() * words.length)]);
} catch (err) {
if (err.status === 500) return msg.say('Could not find any results.');
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = class CowSayCommand extends Command {
});
return msg.code(null, body.cow);
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -52,7 +52,7 @@ module.exports = class DECTalkCommand extends Command {
return null;
} catch (err) {
await this.finish(file, channel);
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = class PortalSendCommand extends Command {
await channel.send(`**${msg.author.tag} (${msg.guild.name})**: ${text}`);
return msg.say(`Message sent to **${channel.name}** in **${channel.guild.name}**!`);
} catch (err) {
return msg.say('Failed to send the message. Try again later!');
return msg.reply('Failed to send the message. Try again later!');
}
}
};
+2
View File
@@ -10,6 +10,7 @@ module.exports = class ShipNameCommand extends Command {
args: [
{
key: 'start',
label: 'start name',
prompt: 'What name should be at the start of the ship name?',
type: 'string',
validate: start => {
@@ -20,6 +21,7 @@ module.exports = class ShipNameCommand extends Command {
},
{
key: 'end',
label: 'end name',
prompt: 'What name should be at the end of the ship name?',
type: 'string',
validate: end => {
+1 -1
View File
@@ -79,7 +79,7 @@ module.exports = class TranslateCommand extends Command {
body.text[0]);
return msg.embed(embed);
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+2 -2
View File
@@ -30,10 +30,10 @@ module.exports = class YodaCommand extends Command {
.get('https://yoda.p.mashape.com/yoda')
.query({ sentence })
.set({ 'X-Mashape-Key': MASHAPE_KEY });
if (!text) return msg.say('Empty, this message is. Try again later, you must.');
if (!text) return msg.reply('Empty, this message is. Try again later, you must.');
return msg.say(text);
} catch (err) {
return msg.say(`Being a jerk again, Yoda is: \`${err.message}\`. Try again later, you must.`);
return msg.reply(`Being a jerk again, Yoda is: \`${err.message}\`. Try again later, you must.`);
}
}
};