chore(async-await): Update to ESM (#9403)

This commit is contained in:
Jiralite 2023-04-16 19:21:30 +01:00 committed by GitHub
parent a210fc64a2
commit cf1f5c0f0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,15 +102,15 @@ Now that you know how Promises work and what they are used for, let's look at an
<CH.Code>
```js
const { Client, GatewayIntentBits } = require('discord.js');
import { Client, Events, GatewayIntentBits } from 'discord.js';
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.once('ready', () => {
client.once(Events.ClientReady, () => {
console.log('I am ready!');
});
client.on('interactionCreate', (interaction) => {
client.on(Events.InteractionCreate, (interaction) => {
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName === 'react') {