generated from voidf1sh/discord-bot-template
Moved a lot from env to config
This commit is contained in:
parent
5d2e1334a9
commit
a41cc9b51d
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"debugMode": true,
|
||||||
"guildId": "",
|
"guildId": "",
|
||||||
"validCommands": []
|
"statusChannelId": "1112151867821146152",
|
||||||
|
"botId": "1074882226665312356",
|
||||||
|
"validCommands": [],
|
||||||
}
|
}
|
3
main.js
3
main.js
@ -16,8 +16,7 @@ const client = new Client({
|
|||||||
// Various imports
|
// Various imports
|
||||||
const fn = require('./modules/functions.js');
|
const fn = require('./modules/functions.js');
|
||||||
const strings = require('./data/strings.json');
|
const strings = require('./data/strings.json');
|
||||||
const debugMode = process.env.DEBUG;
|
const { debugMode, statusChannelId } = require('./data/config.json'); //TODO add debug logic to boot message
|
||||||
const statusChannelId = process.env.STATUSCHANNELID
|
|
||||||
|
|
||||||
client.once('ready', () => {
|
client.once('ready', () => {
|
||||||
fn.collectionBuilders.slashCommands(client);
|
fn.collectionBuilders.slashCommands(client);
|
||||||
|
@ -3,7 +3,7 @@ const dotenv = require('dotenv');
|
|||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
const botId = process.env.BOTID;
|
const { botId } = require('../data/config.json');
|
||||||
const token = process.env.TOKEN;
|
const token = process.env.TOKEN;
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ const dotenv = require('dotenv');
|
|||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
const botId = process.env.BOTID;
|
const { botId } = require('../data/config.json');
|
||||||
const token = process.env.TOKEN;
|
const token = process.env.TOKEN;
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
@ -9,8 +9,9 @@ const Discord = require('discord.js');
|
|||||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = Discord;
|
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = Discord;
|
||||||
|
|
||||||
// Various imports from other files
|
// Various imports from other files
|
||||||
const debugMode = process.env.DEBUG;
|
|
||||||
const config = require('../data/config.json');
|
const config = require('../data/config.json');
|
||||||
|
const { debugMode } = config;
|
||||||
const strings = require('../data/strings.json');
|
const strings = require('../data/strings.json');
|
||||||
const slashCommandFiles = fs.readdirSync('./slash-commands/').filter(file => file.endsWith('.js'));
|
const slashCommandFiles = fs.readdirSync('./slash-commands/').filter(file => file.endsWith('.js'));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user