From 8ce71120f31fd8f590bd7b3f2247ea65450da01d Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 17 Jul 2022 18:15:16 -0400 Subject: Updated to v14 --- bot.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'bot.js') diff --git a/bot.js b/bot.js index eb04ed2..6321257 100644 --- a/bot.js +++ b/bot.js @@ -18,15 +18,14 @@ * along with this program. If not, see . * ***************************************************************************/ -import { Client, MessageEmbed, Collection, version } from 'discord.js'; +import { Client, GatewayIntentBits, EmbedBuilder, Collection, version, InteractionType } from 'discord.js'; import { voiceInit } from './AudioBackend.js'; import { readdirSync, readFileSync } from 'node:fs'; import { webServer } from './WebStream.js'; // import config from './config.json' assert { type: 'json' } Not supported by ESLint yet const { token, statusChannel, voiceChannel, shuffle } = JSON.parse(readFileSync('./config.json')); -const bot = new Client({ intents: ['GUILDS', 'GUILD_MESSAGES', 'GUILD_VOICE_STATES'] }); - +const bot = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates ]}); bot.login(token); // webServer(); @@ -72,7 +71,7 @@ bot.once('ready', async() => { console.log(`Updated bot presence to "${activity.name}"`); // Send bots' status to channel - const readyEmbed = new MessageEmbed() + const readyEmbed = new EmbedBuilder() .setAuthor({ name: bot.user.username, iconURL: bot.user.avatarURL() }) .setDescription('Starting bot...') .setColor('#0066ff'); @@ -85,7 +84,7 @@ bot.once('ready', async() => { }); bot.on('interactionCreate', async interaction => { - if (!interaction.isCommand()) return; + if (!interaction.type === InteractionType.ApplicationCommand) return; const command = bot.commands.get(interaction.commandName); -- cgit v1.2.3