Skip to content

Commit 97dac39

Browse files
authored
chore: tags (#247)
* consistently use ESM syntax across tags
1 parent e2d4531 commit 97dac39

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tags/tags.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ Persisting data through restarts requires a database. Check out the resources be
471471
keywords = ["delay", "sleep", "setTimeout"]
472472
content = """
473473
```js
474-
const { setTimeout } = require('timers/promises');
474+
import { setTimeout } from 'node:timers/promises';
475475
// using async/await
476476
await setTimeout(5000);
477477
...
@@ -526,12 +526,12 @@ keywords = ["code-block", "code-blocks", "cb", "code-box", "codebox"]
526526
content = """
527527
**Codeblocks:**
528528
\\`\\`\\`js
529-
const Discord = require("discord.js");
529+
import { Client } from "discord.js";
530530
// further code
531531
\\`\\`\\`
532532
becomes
533533
```js
534-
const Discord = require("discord.js");
534+
import { Client } from "discord.js";
535535
// further code
536536
```
537537
**Inline Code:**
@@ -698,7 +698,7 @@ content = """
698698
`Error [VoiceConnectionTimeout]: Connection not established within 15 seconds.`
699699
Make sure you have provided the `GuildVoiceStates` intent to the client:
700700
```js
701-
const { Client, GatewayIntentBits } = require('discord.js');
701+
import { Client, GatewayIntentBits } = from 'discord.js';
702702
const client = new Client({
703703
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates]
704704
});
@@ -945,7 +945,7 @@ content = """
945945
If you aren't getting content, embeds or attachments of a message, make sure you have the `MessageContent` intent [enabled in the Developer Portal](https://discord.com/developers/applications) and provide it to your client:
946946
947947
```js
948-
const { Client, GatewayIntentBits } = require('discord.js');
948+
import { Client, GatewayIntentBits } from 'discord.js';
949949
const client = new Client({
950950
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
951951
});
@@ -1088,9 +1088,9 @@ keywords = ["functions", "utils"]
10881088
content = """
10891089
The `Util` class has been removed. Associated functions are now available as top-level imports:
10901090
```diff
1091-
- const { Util } = require('discord.js');
1091+
- import { Util } = from 'discord.js';
10921092
- Util.escapeMarkdown('`string`');
1093-
+ const { escapeMarkdown } = require('discord.js');
1093+
+ import { escapeMarkdown } = from 'discord.js';
10941094
+ escapeMarkdown('`string`');
10951095
```
10961096
"""

0 commit comments

Comments
 (0)