Remove all useless async

This commit is contained in:
Daniel Odendahl Jr
2017-03-24 12:16:58 +00:00
parent 33b7d18d54
commit 0ce7eb3ee1
95 changed files with 287 additions and 287 deletions
+10 -12
View File
@@ -112,14 +112,14 @@ module.exports = class MemeCommand extends commando.Command {
});
}
async run(message) {
run(message) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
}
console.log(`[Command] ${message.content}`);
let [type] = message.content.toLowerCase().split(" ").slice(1);
if (type === "list") {
message.channel.send("**Type Codes:** tenguy, afraid, older, aag, tried, biw, blb, kermit, bd, ch, cbg, wonka, cb, keanu, dsm, live, ants, doge, alwaysonbeat, ermg, facepalm, fwp, fa, fbf, fry, hipster, icanhas, crazypills, mw, noidea, regret, boat, hagrid, sohappy, captain, inigo, iw, ackbar, happening, joker, ive, ll, morpheus, mb, badchoice, mmm, jetpack, red, mordor, oprah, oag, remembers, philosoraptor, jw, patrick, rollsafe, sad-obama, sad-clinton, sadfrog, sad-bush, sad-biden, sad-boehner, saltbae, sarcasticbear, dwight, sb, ss, sf, dodgson, money, sohot, nice, awesome-awkward, awesome, awkward-awesome, awkward, fetch, success, scc, ski, officespace, interesting, toohigh, bs, center, both, winter, xy, buzz, yodawg, uno, yallgot, bad, elf, chosen");
return message.channel.send("**Type Codes:** tenguy, afraid, older, aag, tried, biw, blb, kermit, bd, ch, cbg, wonka, cb, keanu, dsm, live, ants, doge, alwaysonbeat, ermg, facepalm, fwp, fa, fbf, fry, hipster, icanhas, crazypills, mw, noidea, regret, boat, hagrid, sohappy, captain, inigo, iw, ackbar, happening, joker, ive, ll, morpheus, mb, badchoice, mmm, jetpack, red, mordor, oprah, oag, remembers, philosoraptor, jw, patrick, rollsafe, sad-obama, sad-clinton, sadfrog, sad-bush, sad-biden, sad-boehner, saltbae, sarcasticbear, dwight, sb, ss, sf, dodgson, money, sohot, nice, awesome-awkward, awesome, awkward-awesome, awkward, fetch, success, scc, ski, officespace, interesting, toohigh, bs, center, both, winter, xy, buzz, yodawg, uno, yallgot, bad, elf, chosen");
}
else if (message.content.includes(" | ")) {
if (message.content.split(" ").slice(1).join(" ").match(/^[a-zA-Z0-9|.,!?'-\s]+$/)) {
@@ -128,31 +128,29 @@ module.exports = class MemeCommand extends commando.Command {
let bottomrow = memeQuery[1].split("?").join("~q");
let link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`;
if (bottomrow.length > 100) {
message.channel.send(":x: Error! Bottom text is over 100 characters!");
return message.channel.send(":x: Error! Bottom text is over 100 characters!");
}
else if (toprow.length > 100) {
message.channel.send(":x: Error! Top text is over 100 characters!");
return message.channel.send(":x: Error! Top text is over 100 characters!");
}
else {
if (memecodes[type]) {
try {
message.channel.sendFile(link);
}
catch (err) {
return message.channel.sendFile(link).catch(err => {
console.log(err);
message.channel.send(":x: An Error Occurred! Please try again later!");
}
});
}
else {
message.channel.send(":x: Error! Meme type not found! Use `;meme list` to view of list of meme codes!");
return message.channel.send(":x: Error! Meme type not found! Use `;meme list` to view of list of meme codes!");
}
}
}
else {
message.channel.send(":x: Error! Only letters, numbers, periods, commas, apostrophes, exclamation points, and question marks are allowed!");
return message.channel.send(":x: Error! Only letters, numbers, periods, commas, apostrophes, exclamation points, and question marks are allowed!");
}
}
else {
message.channel.send(":x: Split your two choices with a ' | '!");
return message.channel.send(":x: Split your two choices with a ' | '!");
}
}
};