aboutsummaryrefslogtreecommitdiff
path: root/bot.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-03-30 22:01:18 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-03-30 22:01:18 -0400
commitdaf3c1735513bb252614a0047116088e242f7984 (patch)
treec72d573c342b76580d24ca19888150dca94b62bc /bot.js
parent3f81f1086f46b8e1882ed0827483a22929330be3 (diff)
downloadDLAP-daf3c1735513bb252614a0047116088e242f7984.tar.gz
DLAP-daf3c1735513bb252614a0047116088e242f7984.tar.bz2
DLAP-daf3c1735513bb252614a0047116088e242f7984.zip
Fixed list command; Fixed name on some files
Diffstat (limited to 'bot.js')
-rw-r--r--bot.js21
1 files changed, 6 insertions, 15 deletions
diff --git a/bot.js b/bot.js
index 300b7e0..d14f50c 100644
--- a/bot.js
+++ b/bot.js
@@ -1,6 +1,6 @@
/**************************************************************************
*
- * DLMP3 Bot: A Discord bot that plays local audio tracks.
+ * DLAP Bot: A Discord bot that plays local audio tracks.
* (C) Copyright 2022
* Programmed by Andrew Lee
*
@@ -20,22 +20,13 @@
***************************************************************************/
import { Client, MessageEmbed, Collection, version } from 'discord.js'
import { voiceInit } from './AudioBackend.js'
-import fs from 'fs'
+import { readdirSync } from 'node:fs'
import config from './config.json' assert { type: 'json' }
-import path from 'path'
export const bot = new Client({intents: ['GUILDS', 'GUILD_MESSAGES', 'GUILD_VOICE_STATES']});
-const dir = './music';
-
-if (fs.existsSync(dir)) {
- console.log('Music folder detected');
- bot.login(config.token);
-} else {
- console.log('Directory not found. Creating music folder...');
- console.log('Insert your beats to that folder.');
- fs.mkdirSync(dir);
- process.exit(0);
-}
+
+bot.login(config.token);
+
/**
* Project Ideas:
@@ -47,7 +38,7 @@ if (fs.existsSync(dir)) {
// Slash Command Handler
bot.commands = new Collection();
-const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
+const commandFiles = readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const { default: command } = await import(`./commands/${file}`);