ignore audio-type files rather than creating a new directory
https://github.com/chebro/discord-voice-recorder/pull/18#discussion_r626809393
This commit is contained in:
parent
bfbd4a4b0b
commit
608ed8f725
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,3 @@
|
||||||
config.json
|
config.json
|
||||||
node_modules
|
node_modules
|
||||||
recordings
|
|
||||||
.idea
|
.idea
|
||||||
|
|
9
index.js
9
index.js
|
@ -3,8 +3,6 @@ const client = new Discord.Client(
|
||||||
{intents: ["GUILD_MESSAGES", "GUILD_VOICE_STATES", "GUILDS"]}
|
{intents: ["GUILD_MESSAGES", "GUILD_VOICE_STATES", "GUILDS"]}
|
||||||
);
|
);
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const config = require('./config.json');
|
const config = require('./config.json');
|
||||||
const commands = require(`./bin/commands`);
|
const commands = require(`./bin/commands`);
|
||||||
|
|
||||||
|
@ -15,16 +13,11 @@ if(!config.PREFIX || !config.BOT_TOKEN) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//create the recordings directory in case people forget to do so
|
|
||||||
try {
|
|
||||||
fs.mkdirSync("./recordings/");
|
|
||||||
} catch(ignored) {}
|
|
||||||
|
|
||||||
client.on('message', msg => {
|
client.on('message', msg => {
|
||||||
if (msg.content.startsWith(config.PREFIX)) {
|
if (msg.content.startsWith(config.PREFIX)) {
|
||||||
const commandBody = msg.content.substring(config.PREFIX.length).split(' ');
|
const commandBody = msg.content.substring(config.PREFIX.length).split(' ');
|
||||||
const channelName = commandBody[1];
|
const channelName = commandBody[1];
|
||||||
|
|
||||||
if (commandBody[0] === ('enter') && commandBody[1]) commands.enter(msg, channelName);
|
if (commandBody[0] === ('enter') && commandBody[1]) commands.enter(msg, channelName);
|
||||||
if (commandBody[0] === ('exit')) commands.exit(msg);
|
if (commandBody[0] === ('exit')) commands.exit(msg);
|
||||||
}
|
}
|
||||||
|
|
5
recordings/.gitignore
vendored
Normal file
5
recordings/.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
# ignore audio-type files
|
||||||
|
*.pcm
|
||||||
|
*.mp3
|
||||||
|
*.opus
|
Loading…
Reference in a new issue