aboutsummaryrefslogtreecommitdiff
path: root/bot.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-07-17 18:15:16 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-07-17 18:15:16 -0400
commit8ce71120f31fd8f590bd7b3f2247ea65450da01d (patch)
treea88becb45d43534de7fa1a07e294d38006b1fd37 /bot.js
parent6664618ed1225e17f2e98ee8a44179181e3dcf9b (diff)
downloadDLAP-8ce71120f31fd8f590bd7b3f2247ea65450da01d.tar.gz
DLAP-8ce71120f31fd8f590bd7b3f2247ea65450da01d.tar.bz2
DLAP-8ce71120f31fd8f590bd7b3f2247ea65450da01d.zip
Updated to v14
Diffstat (limited to 'bot.js')
-rw-r--r--bot.js9
1 files changed, 4 insertions, 5 deletions
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 <https://www.gnu.org/licenses/>.
*
***************************************************************************/
-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);