From 08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 28 Mar 2022 19:53:00 -0400 Subject: Removed old cmd handler; Brought back join; New cmd --- bot.js | 107 ----------------------------------------------------------------- 1 file changed, 107 deletions(-) (limited to 'bot.js') diff --git a/bot.js b/bot.js index 957f40a..47ef48c 100644 --- a/bot.js +++ b/bot.js @@ -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); - } - -});*/ -- cgit v1.2.3