diff --git a/.gitignore b/.gitignore index 5cfbe76..639b14e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ config.json node_modules -recordings .idea diff --git a/index.js b/index.js index 68fd051..6d0a519 100644 --- a/index.js +++ b/index.js @@ -3,8 +3,6 @@ const client = new Discord.Client( {intents: ["GUILD_MESSAGES", "GUILD_VOICE_STATES", "GUILDS"]} ); -const fs = require("fs"); - const config = require('./config.json'); const commands = require(`./bin/commands`); @@ -15,16 +13,11 @@ if(!config.PREFIX || !config.BOT_TOKEN) { process.exit(1); } -//create the recordings directory in case people forget to do so -try { - fs.mkdirSync("./recordings/"); -} catch(ignored) {} - client.on('message', msg => { if (msg.content.startsWith(config.PREFIX)) { const commandBody = msg.content.substring(config.PREFIX.length).split(' '); const channelName = commandBody[1]; - + if (commandBody[0] === ('enter') && commandBody[1]) commands.enter(msg, channelName); if (commandBody[0] === ('exit')) commands.exit(msg); } diff --git a/recordings/.gitignore b/recordings/.gitignore new file mode 100644 index 0000000..72ce85e --- /dev/null +++ b/recordings/.gitignore @@ -0,0 +1,5 @@ + +# ignore audio-type files +*.pcm +*.mp3 +*.opus