more bad dalton coding fixes
This commit is contained in:
46
bot.js
46
bot.js
@@ -485,33 +485,39 @@ client.on('message', message => {
|
||||
break;
|
||||
|
||||
case 'summon':
|
||||
// Dalton's image summon command.
|
||||
// Checks for banned author's using a hard coded list of discord ids.
|
||||
// Also rudely cleans garbage entries.
|
||||
let bannedAuthors = ['143999140878090240'];
|
||||
if (bannedAuthors.contains(message.author)) {
|
||||
try {
|
||||
// Dalton's image summon command.
|
||||
// Checks for banned author's using a hard coded list of discord ids.
|
||||
// Also rudely cleans garbage entries.
|
||||
let banned_authors = ['143999140878090240'];
|
||||
if (banned_authors.includes(message.author)) {
|
||||
|
||||
let messageSplit = message.content.substring(2).split(' ');
|
||||
if (messageSplit.length >= 2) {
|
||||
let redditToSummon = messageSplit[1].replace(/[^a-zA-Z0-9_\-]+/g, "");
|
||||
let messageSplit = message.content.substring(2).split(' ');
|
||||
if (messageSplit.length >= 2) {
|
||||
let redditToSummon = messageSplit[1].replace(/[^a-zA-Z0-9_\-]+/g, "");
|
||||
|
||||
// Valid Argument
|
||||
if (redditToSummon) {
|
||||
// Valid Argument
|
||||
if (redditToSummon) {
|
||||
|
||||
message.channel.send(message.author + ' summons *' + redditToSummon + '*\n');
|
||||
let site_response = bestEffortRequest(redditToSummon, 5);
|
||||
message.channel.send(message.author + ' summons *' + redditToSummon + '*\n');
|
||||
let site_response = bestEffortRequest(redditToSummon, 5);
|
||||
|
||||
if (site_response) {
|
||||
message.channel.send(redditResponse);
|
||||
if (site_response) {
|
||||
message.channel.send(redditResponse);
|
||||
}
|
||||
|
||||
// Missing Argumentg
|
||||
} else {
|
||||
message.reply("wut do i summon?");
|
||||
}
|
||||
|
||||
// Missing Argument
|
||||
} else {
|
||||
message.reply("wut do i summon?");
|
||||
}
|
||||
} else {
|
||||
message.reply("You're a bad boi and a banned author, you can't summon til you learn to behave.")
|
||||
}
|
||||
} else {
|
||||
message.reply("You're a bad boi and a banned author, you can't summon til you learn to behave.")
|
||||
} catch (error) {
|
||||
message.channel.send(error.stack);
|
||||
message.channel.send(error.name);
|
||||
message.channel.send(error.message);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user