-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
Which package is this bug report for?
discord.js
Issue description
I am trying to use discord.js with TypeScript. However, I am unable to import GatewayIntentBits. My IDE is complaining that the element has not been exported. Is passing gateway intents as strings instead of using the enum the only option in typescript?
Minimal code in a .ts file:
import { Client, GatewayIntentBits } from 'discord.js';
const client = new Client({ intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildPresences,
]});and my tsconfig:
{
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"verbatimModuleSyntax": true,
"module": "es2022"
}
}Code sample
No response
Versions
- discord.js 14.16.3
- Node.js v20.18.0
- TypeScript 5.6.3
Issue priority
Low (slightly annoying)
Which partials do you have configured?
No Partials
Which gateway intents are you subscribing to?
Guilds, GuildMembers, GuildPresences, GuildMessages, MessageContent
I have tested this issue on a development release
No response
Metadata
Metadata
Assignees
Labels
No labels