mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 22:15:37 +00:00
feat: Added .env file, and moved some properties from config.json to .env file
This commit is contained in:
1 parent
d96b40e277
commit
cc3fd9569c
9 files changed
+50
-19
No files matched your search
@@ -1,7 +1,8 @@
|
||||
const fs = require('node:fs');
|
||||
const logger = require('./services/logger.js');
|
||||
const { REST, Routes } = require('discord.js');
|
||||
const { token, clientId, systemServerGuildIds } = require('./config.json');
|
||||
const { systemServerGuildIds } = require('./config.json');
|
||||
require('dotenv').config();
|
||||
|
||||
const systemCommands = [];
|
||||
const systemCommandFiles = fs
|
||||
@@ -13,7 +14,7 @@ for (const file of systemCommandFiles) {
|
||||
systemCommands.push(systemCommand.data.toJSON());
|
||||
}
|
||||
|
||||
const rest = new REST({ version: '10' }).setToken(token);
|
||||
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_TOKEN);
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
@@ -29,7 +30,7 @@ const rest = new REST({ version: '10' }).setToken(token);
|
||||
|
||||
for (const systemServerGuildId of systemServerGuildIds) {
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(clientId, systemServerGuildId),
|
||||
Routes.applicationGuildCommands(process.env.DISCORD_CLIENT_ID, systemServerGuildId),
|
||||
{
|
||||
body: systemCommands
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user