aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-03-25 13:57:05 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-03-25 13:57:05 -0400
commit4f927b2a5e4c95e083c7f7be58bb1b9c61f94abe (patch)
tree2f650c997d1fdb3bcc4f454e06e980f9201cdde1
parent1c557f7d54cf0cc51dcdb84c253fab34b113208c (diff)
downloadDLAP-4f927b2a5e4c95e083c7f7be58bb1b9c61f94abe.tar.gz
DLAP-4f927b2a5e4c95e083c7f7be58bb1b9c61f94abe.tar.bz2
DLAP-4f927b2a5e4c95e083c7f7be58bb1b9c61f94abe.zip
2022 update
-rw-r--r--bot.js16
-rw-r--r--package.json2
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"
},