From 4f927b2a5e4c95e083c7f7be58bb1b9c61f94abe Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 25 Mar 2022 13:57:05 -0400 Subject: 2022 update --- bot.js | 16 +++++++++------- package.json | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bot.js b/bot.js index 5c15ae0..7696f11 100644 --- a/bot.js +++ b/bot.js @@ -27,7 +27,7 @@ const player = createAudioPlayer(); const connection = joinVoiceChannel({ channelId: config.voiceChannel, guildId: config.guildID, - adapterCreator: config.guildID + //adapterCreator: bot.guilds.client }); let dispatcher; let audio; @@ -54,6 +54,7 @@ function playAudio() { resource = createAudioResource('./music/' + audio); player.play(resource); + connection.subscribe(player); console.log('Now playing ' + audio); fileData = "Now Playing: " + audio; @@ -102,14 +103,14 @@ bot.on('ready', () => { console.log(`Updated bot presence to "${bot.user.activity}"`); const readyEmbed = new Discord.MessageEmbed() - .setAuthor(`${bot.user.username}`, bot.user.avatarURL()) + .setAuthor({name:`${bot.user.username}`, url:bot.user.avatarURL()}) .setDescription('Starting bot...') .setColor('#0066ff') let statusChannel = bot.channels.cache.get(config.statusChannel); if (!statusChannel) return console.error('The status channel does not exist! Skipping.'); statusChannel.send({ embeds: [readyEmbed]}); - //console.log('Connected to the voice channel.'); + console.log('Connected to the voice channel.'); playAudio(); }); @@ -123,16 +124,17 @@ bot.on('messageCreate', async msg => { // Public allowed commands if (command == 'help') { - if (!msg.guild.member(bot.user).hasPermission('EMBED_LINKS')) return msg.reply('**ERROR: This bot doesn\'t have the permission to send embed links please enable them to use the full help.**'); + //if (!msg.guild.member(bot.user).hasPermission('EMBED_LINKS')) return msg.reply('**ERROR: This bot doesn\'t have the permission to send embed links please enable them to use the full help.**'); const helpEmbed = new Discord.MessageEmbed() - .setAuthor(`${bot.user.username} Help`, bot.user.avatarURL()) + .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('© Copyright 2020 Andrew Lee. Licensed with GPL-3.0.') + .setFooter({text:'© Copyright 2022 Andrew Lee. Licensed with GPL-3.0.'}) .setColor('#0066ff') msg.channel.send({ embeds: [helpEmbed]}); + } if (command == 'ping') { @@ -201,7 +203,7 @@ bot.on('messageCreate', async msg => { console.log(err); }); const statusEmbed = new Discord.MessageEmbed() - .setAuthor(`${bot.user.username}`, bot.user.avatarURL()) + .setAuthor({title:bot.user.username, url:bot.user.avatarURL()}) .setDescription(`That\'s all folks! Powering down ${bot.user.username}...`) .setColor('#0066ff') let statusChannel = bot.channels.cache.get(config.statusChannel); diff --git a/package.json b/package.json index 4b180b8..0f20f36 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "@discordjs/opus": "^0.3.2", "@discordjs/voice": "^0.5.5", - "discord.js": "^13.0.0-dev.t1627831263.774f5b7", + "discord.js": "^13.6.0", "ffmpeg-static": "^4.2.5", "libsodium-wrappers": "^0.7.9" }, -- cgit v1.2.3