Handle cases where error message can't be sent, added intents, disable private channels collection

This commit is contained in:
TheEssem 2021-04-14 19:57:35 -05:00
parent 7cc8ac7b6b
commit e209199134
3 changed files with 17 additions and 5 deletions

10
app.js
View File

@ -29,6 +29,14 @@ new Master(`Bot ${process.env.TOKEN}`, "/shard.js", {
users: true,
repliedUser: true
},
guildSubscriptions: false
guildSubscriptions: false,
intents: [
"guilds",
"guildVoiceStates",
"guildMessages",
"guildMessageReactions",
"directMessages",
"directMessageReactions"
]
}
});

View File

@ -121,10 +121,12 @@ module.exports = async (client, message) => {
await client.createMessage(message.channel.id, `${message.author.mention}, the request timed out before I could download that image. Try uploading your image somewhere else.`);
} else {
logger.error(error.toString());
await client.createMessage(message.channel.id, "Uh oh! I ran into an error while running this command. Please report the content of the attached file here or on the esmBot Support server: <https://github.com/esmBot/esmBot/issues>", [{
file: Buffer.from(`Message: ${error}\n\nStack Trace: ${error.stack}`),
name: "error.txt"
}]);
try {
await client.createMessage(message.channel.id, "Uh oh! I ran into an error while running this command. Please report the content of the attached file here or on the esmBot Support server: <https://github.com/esmBot/esmBot/issues>", [{
file: Buffer.from(`Message: ${error}\n\nStack Trace: ${error.stack}`),
name: "error.txt"
}]);
} catch { /* silently ignore */ }
}
}
};

View File

@ -111,6 +111,8 @@ class Shard extends Base {
// connect to lavalink
if (!sound.status && !sound.connected) await sound.connect(this.bot);
this.bot.privateChannels.limit = 0;
await database.setup();
// set activity (a.k.a. the gamer code)