accept discord token as env
we only really need that to function anyway, other things like jellyfin will just not do anything and we have default value for avatar reset.
This commit is contained in:
12
index.js
12
index.js
@@ -1,4 +1,14 @@
|
||||
const config = require('./config.json');
|
||||
let config = {};
|
||||
try {
|
||||
config = require('./config.json');
|
||||
} catch {
|
||||
if (process.env.DISCORD && process.env.DISCORD != "TOKEN_HERE") {
|
||||
config.token = process.env.DISCORD;
|
||||
} else {
|
||||
console.error("FATAL: Discord token required. Either pass it as an environment variable \"DISCORD\", or fill out config.json.default.");
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
// the basic discord setup stuff yoinked from their guide
|
||||
const { Client, Events, GatewayIntentBits, Partials, ActivityType, MessageFlags, Collection } = require('discord.js');
|
||||
const client = new Client({
|
||||
|
||||
Reference in New Issue
Block a user