d.js docs
d.js docs
DIdiscord.js - Imagine ❄
Created by Инот on 12/17/2024 in #djs-questions
Disable init information from WS with Guild intent
:guide: Miscellaneous: Cache customization read more
10 replies
DIdiscord.js - Imagine ❄
Created by Incorecc on 12/16/2024 in #djs-voice
Bot does not play any music, with no error message at all
To debug your voice connection and player: - Use debug: true when creating your VoiceConnection and AudioPlayer - Add an event listener to the <VoiceConnection> and the <AudioPlayer>:
// Add one for each class if applicable
<AudioPlayer | VoiceConnection>
.on('debug', console.log)
.on('error', console.error)
// Add one for each class if applicable
<AudioPlayer | VoiceConnection>
.on('debug', console.log)
.on('error', console.error)
- Add an error listener to the stream you are passing to the resource:
<Stream>.on('error', console.error)
<Stream>.on('error', console.error)
Note: The <> represents classes that need to be adapted to their respective name in your code
6 replies
DIdiscord.js - Imagine ❄
Created by 𝗦𝗮𝘁𝗮𝗻 on 12/17/2024 in #djs-questions
Question on message component collector
:method: BaseInteraction#isButton() @14.16.3 Indicates whether this interaction is a ButtonInteraction.
18 replies
DIdiscord.js - Imagine ❄
Created by 𝗦𝗮𝘁𝗮𝗻 on 12/17/2024 in #djs-questions
Question on message component collector
:method: ButtonInteraction#update() @14.16.3 Updates the original message of the component on which the interaction was received on.
// Remove the components from the message
interaction.update({
content: "A component interaction was received",
components: []
})
.then(console.log)
.catch(console.error);
// Remove the components from the message
interaction.update({
content: "A component interaction was received",
components: []
})
.then(console.log)
.catch(console.error);
18 replies
DIdiscord.js - Imagine ❄
Created by Dopi on 12/16/2024 in #djs-questions
SlashCommand interaction is undefined
We highly recommend you extend the Client structure properly instead of just attaching custom properties like .commands to the regular discord.js Client instance. - Using typescript, you might want to consider casting or augmenting the module type
15 replies
DIdiscord.js - Imagine ❄
Created by tholeb on 12/15/2024 in #djs-questions
How to make a user installed app
HTTP-only applications receive interactions through HTTP webhooks instead of the Discord Gateway. Bots that are not connected to the Gateway, but use HTTP interactions appear as online without a status. Discord.js does not support HTTP interactions. Use discord-interactions instead.
16 replies
DIdiscord.js - Imagine ❄
Created by RLodka on 12/15/2024 in #djs-questions
How to import embeds from 1 file into 2 without creating embed in 2 file?
:mdn: JavaScript object basics Congratulations, you've reached the end of our first JS objects article — you should now have a good idea of how to work with objects in JavaScript — including creating your own simple objects. You should also appreciate that objects are very useful as structures for storing related data and functionality — if you tried to keep track of all the properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names. Objects let us keep the information safely locked away in their own package, out of harm's way.
40 replies
DIdiscord.js - Imagine ❄
Created by RLodka on 12/15/2024 in #djs-questions
How to import embeds from 1 file into 2 without creating embed in 2 file?
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
40 replies
DIdiscord.js - Imagine ❄
Created by tholeb on 12/15/2024 in #djs-questions
How to make a user installed app
:method: SlashCommandBuilder#setContexts() @1.9.0 Sets the contexts of this command.
16 replies
DIdiscord.js - Imagine ❄
Created by tholeb on 12/15/2024 in #djs-questions
How to make a user installed app
:method: SlashCommandBuilder#setIntegrationTypes() @1.9.0 Sets the integration types of this command.
16 replies
DIdiscord.js - Imagine ❄
Created by Fedde on 12/15/2024 in #djs-questions
Discord bot
Errors such as ECONNRESET, ConnectTimeoutError, SocketError: other side closed indicate a network issue * Free or shared hosting providers often come with significant limitations * Another indication of these issues are 'Unknown Interaction' errors.
5 replies
DIdiscord.js - Imagine ❄
Created by Ali on 12/15/2024 in #djs-questions
No discord user id mention in embed
Some parts of an embed will not properly resolve mentions (leave them in the <@348607796335607817> format): - Author name - Footer text - Embed title - Embed field name
10 replies
DIdiscord.js - Imagine ❄
Created by Martoz on 12/15/2024 in #djs-questions
error modal
If you are waiting for button or select menu input from a specific message, don't create the collector on the channel. - Channel collectors return component interactions for any component within that channel.
- <Channel>.createMessageComponentCollector(…)
+ <Message>.createMessageComponentCollector(…)
- <Channel>.createMessageComponentCollector(…)
+ <Message>.createMessageComponentCollector(…)
18 replies
DIdiscord.js - Imagine ❄
Created by Mephisto on 12/14/2024 in #djs-questions
Unknown Emoji Error when trying to react with unicode emojis
discord.js includes multiple sub-packages, installing these separately can mess with internal code:
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
16 replies
DIdiscord.js - Imagine ❄
Created by Mephisto on 12/14/2024 in #djs-questions
Unknown Emoji Error when trying to react with unicode emojis
- Custom emojis: \:name:<a:name:id> - Twemojis: \:name: ➞ unicode representation - Emoji picker: WIN + . / CMD + CTRL + SPACE / CTRL + . - Right-clicking any emoji will not copy its id!
16 replies
DIdiscord.js - Imagine ❄
Created by Papa Smerf on 12/13/2024 in #djs-questions
Is there a way to ban user installed apps from running interactions?
:dtypes: v10: PermissionFlagsBits read more
9 replies
DIdiscord.js - Imagine ❄
Created by Daniet Cinema on 12/13/2024 in #djs-questions
Checking Guild Subscription
documentation suggestion for @Daniet Cinema: :property: BaseInteraction#entitlements @14.16.3 The entitlements for the invoking user, representing access to premium SKUs
5 replies
DIdiscord.js - Imagine ❄
Created by wowie on 12/11/2024 in #djs-questions
Issue Launching
discord.js includes multiple sub-packages, installing these separately can mess with internal code:
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
24 replies
DIdiscord.js - Imagine ❄
Created by Michel Migalov on 12/11/2024 in #djs-questions
Creating an event via a bot.
:propertysignature: GuildScheduledEventCreateOptions#channel @14.16.3 The channel of the guild scheduled event This is required if entityType is GuildScheduledEventEntityType.StageInstance or GuildScheduledEventEntityType.Voice
9 replies
DIdiscord.js - Imagine ❄
Created by Michel Migalov on 12/11/2024 in #djs-questions
Creating an event via a bot.
:property: Guild#scheduledEvents @14.16.3 A manager of the scheduled events of this guild
9 replies