mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
chore(async-await): Update to ESM (#9403)
This commit is contained in:
@@ -102,15 +102,15 @@ Now that you know how Promises work and what they are used for, let's look at an
|
|||||||
<CH.Code>
|
<CH.Code>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { Client, GatewayIntentBits } = require('discord.js');
|
import { Client, Events, GatewayIntentBits } from 'discord.js';
|
||||||
|
|
||||||
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
|
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
|
||||||
|
|
||||||
client.once('ready', () => {
|
client.once(Events.ClientReady, () => {
|
||||||
console.log('I am ready!');
|
console.log('I am ready!');
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('interactionCreate', (interaction) => {
|
client.on(Events.InteractionCreate, (interaction) => {
|
||||||
if (!interaction.isChatInputCommand()) return;
|
if (!interaction.isChatInputCommand()) return;
|
||||||
|
|
||||||
if (interaction.commandName === 'react') {
|
if (interaction.commandName === 'react') {
|
||||||
|
|||||||
Reference in New Issue
Block a user