diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-03-28 19:53:00 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-03-28 19:53:00 -0400 |
| commit | 08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43 (patch) | |
| tree | 965f234d6683b726bddc07ce19914e84b335cd44 /bot.js | |
| parent | 0f5a1a252964861e149a0d784a90f0ad74aa09cb (diff) | |
| download | DLAP-08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43.tar.gz DLAP-08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43.tar.bz2 DLAP-08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43.zip | |
Removed old cmd handler; Brought back join; New cmd
Diffstat (limited to 'bot.js')
| -rw-r--r-- | bot.js | 107 |
1 files changed, 0 insertions, 107 deletions
@@ -99,110 +99,3 @@ bot.on('interactionCreate', async interaction => { } } }); - -/* -bot.on('messageCreate', async msg => { - if (msg.author.bot) return; - if (!msg.guild) return; - if (!msg.content.startsWith(config.prefix)) return; - let command = msg.content.split(' ')[0]; - command = command.slice(config.prefix.length); - - // Public allowed commands - - if (command === 'help') { - const helpEmbed = new MessageEmbed() - .setAuthor({name:`${bot.user.username} Help`, iconURL:bot.user.avatarURL()}) - .setDescription(`Currently playing \`${audio}\`.`) - .addField('Public Commands', `${config.prefix}help\n${config.prefix}ping\n${config.prefix}git\n${config.prefix}playing\n${config.prefix}about\n`, true) - .addField('Bot Owner Only', `${config.prefix}join\n${config.prefix}resume\n${config.prefix}pause\n${config.prefix}skip\n${config.prefix}leave\n${config.prefix}stop\n`, true) - .setFooter({text:'© Copyright 2022 Andrew Lee. Licensed with GPL-3.0.'}) - .setColor('#0066ff') - - msg.channel.send({ embeds: [helpEmbed]}); - - } - - if (command === 'ping') { - msg.reply('Pong!'); - } - - if (command === 'git') { - msg.reply('This is the source code of this project.\nhttps://github.com/Alee14/DLMP3'); - } - - if (command === 'playing') { - msg.channel.send('Currently playing `' + audio + '`.'); - } - - if (command === 'about') { - msg.channel.send('The bot code was created by Andrew Lee (Alee#4277). Written in Discord.JS and licensed with GPL-3.0.'); - } - - if (![config.botOwner].includes(msg.author.id)) return; - - // Bot owner exclusive - - if (command === 'join') { - msg.reply('Joining voice channel.'); - //voiceInit(); - } - - if (command === 'resume') { - msg.reply('Resuming music.'); - //player.unpause(); - } - - if (command === 'pause') { - msg.reply('Pausing music.'); - //player.pause(); - } - - if (command === 'skip') { - msg.reply('Skipping `' + audio + '`...'); - //player.pause() - //playAudio(); - } - - if (command === 'leave') { - msg.reply('Leaving voice channel.'); - console.log('Leaving voice channel.'); - if (txtFile === true) { - fileData = "Now Playing: Nothing"; - fs.writeFile("now-playing.txt", fileData, (err) => { - if (err) - console.log(err); - }); - } - audio = "Not Playing"; - //player.stop(); - const connection = getVoiceConnection(msg.guild.id); - connection.destroy(); - - } - - if (command === 'stop') { - await msg.reply('Powering off...'); - if (txtFile === true) { - fileData = "Now Playing: Nothing"; - await fs.writeFile("now-playing.txt", fileData, (err) => { - if (err) - console.log(err); - }); - } - const statusEmbed = new MessageEmbed() - .setAuthor({name:bot.user.username, iconURL:bot.user.avatarURL()}) - .setDescription(`That\'s all folks! Powering down ${bot.user.username}...`) - .setColor('#0066ff') - let statusChannel = bot.channels.cache.get(config.statusChannel); - if (!statusChannel) return console.error('The status channel does not exist! Skipping.'); - await statusChannel.send({ embeds: [statusEmbed] }); - console.log('Powering off...'); - player.stop(); - const connection = getVoiceConnection(msg.guild.id); - connection.destroy(); - bot.destroy(); - process.exit(0); - } - -});*/ |
