Skip to content
Permalink
Browse files

this literally took so many tears to debug

  • Loading branch information
AustinTi committed Aug 18, 2019
1 parent d65a8a2 commit 3599b55a42a1d25aff926f537cb75269cd4114f6
Showing with 26 additions and 4 deletions.
  1. +1 −1 commands/eval.js
  2. +7 −1 events/guildCreate.js
  3. +8 −0 events/message.js
  4. +6 −1 index.js
  5. +4 −1 misc.js
@@ -11,7 +11,7 @@ module.exports.run = async (client, message, args, cmdHook, roCMD, DBResult) =>
try {
const evaled = eval(roCMD);
let output = `\`\`\`js\n${evaled}\n\`\`\``
if(output.length > 1028) output = "\`\`\`js\nundefined\`\`\`";
if(output.length > 1028) output = "\`\`\`js\noverflow\`\`\`";
const embed = new Discord.RichEmbed()
.setColor(0x10525C)
.setTitle("✅ Eval Successful")
@@ -4,6 +4,12 @@ require("moment-timezone");
require("moment-duration-format");

module.exports.run = async (client, guild) => {
client.db.createGuild(guild, client);
try {client.db.createGuild(guild, client);
} catch(err) {
client.misc.cmdHook(null, "info", "misconfig", null, guild, null);
guild.owner.send("There is an error in your server config! This most likely means I have/had no permissions in any text channel. I automagically left the server but can be re-added once you fix your config. Thank you!")
.then(() => guild.leave());
return;
}
client.misc.cmdHook(null, "info", "join", null, guild, null);
}
@@ -8,6 +8,14 @@ module.exports.run = async (client, message) => {
if(!message.guild) return;
if(message.author.bot) return;
let DBResult = await client.db.r.table("guilds").get(message.guild.id).run();
try {
var check = DBResult.prefix
} catch (err) {
client.misc.cmdHook(null, "info", "misconfig", null, message.guild, null);
message.guild.owner.send("There is an error in your server config! This most likely means I have/had no permissions in any text channel. I automagically left the server but can be re-added once you fix your config. Thank you!")
.then(() => message.guild.leave());
return;
}
let BLResult = await client.bl.r.table("blacklist").get(message.author.id).run();
if(message.content.indexOf(DBResult.prefix) !== 0) return;

@@ -71,9 +71,14 @@ let parser = new RSSParser();
for(let tz of tzArray) {
cron.schedule('2 0 */1 * *' , async () => {
let scheduleWait = require("util").promisify(setTimeout);
for(let guild of client.guilds.array()) {
for(let guild of client.guilds.values()) {
let wait = require("util").promisify(setTimeout);
let DBResult = await client.db.r.table("guilds").get(guild.id).run();
try {
var check = DBResult.dailyChannel
} catch (err) {
continue;
}
let dailyCObj = client.channels.get(`${DBResult.dailyChannel}`);
let dailyAdult = ""
if(DBResult.adult === true) {
@@ -124,12 +124,15 @@ module.exports = class {
break;
case "channelDelete":
console.log(`[${clc.blue("INFO")}] Guild "${assocGuild.name}" (ID: ${assocGuild.id}) has deleted their daily channel. Resetting to ${content}`);
embedContent = [0x10525c, `Guild \`${assocGuild.name}\` (ID: ${assocGuild.id}) deleted their daily channel.`, `Resetting to __${content}__`];
embedContent = [0x10525c, `Guild \`${assocGuild.name}\` (ID: ${assocGuild.id}) has deleted their daily channel.`, `Resetting to __${content}__`];
break;
case "start":
console.log(`[${clc.blue("INFO")}] Bot Started!`);
embedContent = [0x10525c, `Bot Started!`, ``];
break;
case "misconfig":
console.log(`[${clc.blue("INFO")}] Guild "${assocGuild.name}" (ID: ${assocGuild.id}) has an invalid server config. Leaving...`);
embedContent = [0x10525c, `Guild \`${assocGuild.name}\` (ID: ${assocGuild.id}) has an invalid server config.`, `__Leaving...__`]
}
break;
}

0 comments on commit 3599b55

Please sign in to comment.
You can’t perform that action at this time.