forked from PluralFlux/PluralFlux
Compare commits
4 Commits
Develop
...
webhook-re
| Author | SHA1 | Date | |
|---|---|---|---|
| 61d4e121a9 | |||
| 63b2f182bb | |||
| baf2f51773 | |||
| 6c9c253a70 |
@@ -10,6 +10,7 @@ const { AppDataSource } = require("../database/data-source");
|
||||
env.config();
|
||||
|
||||
const token = process.env.FLUXER_BOT_TOKEN;
|
||||
const debug = process.env.debug;
|
||||
|
||||
if (!token) {
|
||||
console.error("Missing FLUXER_BOT_TOKEN environment variable.");
|
||||
@@ -63,12 +64,15 @@ module.exports.handleMessageCreate = async function(message) {
|
||||
}
|
||||
}
|
||||
catch(error) {
|
||||
console.error(error);
|
||||
if(debug){console.error("An error occurred at unix timestamp " + Date.now() + "while processing the command: " + message + " with error:" + error);}
|
||||
else{console.error(error);}
|
||||
process.exit(2); //need this for now just to make sure the bot continues to restart on errors, since it would seem that fluxer.js doesn't define custom error types. TODO: map out some exit codes
|
||||
}
|
||||
}
|
||||
|
||||
client.on(Events.Ready, () => {
|
||||
console.log(`Logged in as ${client.user?.username}`);
|
||||
if(debug){console.log(Date.now() + `: Currently running in debug mode!`)}
|
||||
});
|
||||
|
||||
let guildCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user