diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-07-20 16:09:35 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-07-20 16:09:35 -0400 |
| commit | 2c4a38fa4b41023f7f59cdce5242cb440751dbd0 (patch) | |
| tree | 2beb8435b837b53fef10ec84a56172051ddff2b1 /bot.js | |
| parent | a0ce13991b61b246f5018f0c380595ec1c6dfed3 (diff) | |
| download | DLAP-2c4a38fa4b41023f7f59cdce5242cb440751dbd0.tar.gz DLAP-2c4a38fa4b41023f7f59cdce5242cb440751dbd0.tar.bz2 DLAP-2c4a38fa4b41023f7f59cdce5242cb440751dbd0.zip | |
Now you must add more stuff in the config.json file now
Diffstat (limited to 'bot.js')
| -rw-r--r-- | bot.js | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -9,15 +9,12 @@ const Discord = require('discord.js'); const fs = require('fs'); const client = new Discord.Client(); -const config = require('./token.json'); -var botOwner = '242775871059001344'; -var voiceChannel = '734184921433899108'; -var prefix = '!'; +const config = require('./config.json'); client.login(config.token); function playAudio() { - const channel = client.channels.cache.get(voiceChannel); + const channel = client.channels.cache.get(config.voiceChannel); if (!channel) return console.error('The channel does not exist!'); channel.join().then(connection => { @@ -46,7 +43,7 @@ function playAudio() { client.on('ready', () => { console.log('Bot is ready!') console.log(`Logged in as ${client.user.tag}!`); - console.log(`Prefix: ${prefix}`); + console.log(`Prefix: ${config.prefix}`); client.user.setStatus('invisible'); playAudio(); }); @@ -54,11 +51,11 @@ client.on('ready', () => { client.on('message', async msg => { if (msg.author.bot) return; if (!msg.guild) return; - if (!msg.content.startsWith(prefix)) return; - if (![botOwner].includes(msg.author.id)) return; + if (!msg.content.startsWith(config.prefix)) return; + if (![config.botOwner].includes(msg.author.id)) return; let command = msg.content.split(' ')[0]; - command = command.slice(prefix.length); + command = command.slice(config.prefix.length); if (command == 'ping') { msg.reply('Pong!'); @@ -79,9 +76,9 @@ client.on('message', async msg => { if (command == 'skip') { } - + if (command == 'leave') { - const channel = client.channels.cache.get(voiceChannel); + const channel = client.channels.cache.get(config.voiceChannel); if (!channel) return console.error('The channel does not exist!'); msg.reply('Leaving voice channel.') console.log('Leaving voice channel.'); |
