LeMorrow
LeMorrow
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 10/21/2022 in #djs-questions
Is there any way to see the raw HTTP requests D.JS is doing towards the Discord API?
^^
5 replies
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 9/8/2022 in #djs-questions
Internal shards stopped reconnecting after 8d uptime
9 replies
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 8/31/2022 in #djs-questions
Even if interaction is not replied - Interaction has already been acknowledged
I check both this.interaction.replied || !this.interaction.isRepliable() before replying to an interaction, but I still get Interaction has already been acknowledged. Is this a bug?
if (this.interaction.replied || !this.interaction.isRepliable()) {
return;
}

// I get this RANDOMLY here: DiscordAPIError[40060]: Interaction has already been acknowledged.
await this.interaction.reply({ content: content, ephemeral: ephemeral });
if (this.interaction.replied || !this.interaction.isRepliable()) {
return;
}

// I get this RANDOMLY here: DiscordAPIError[40060]: Interaction has already been acknowledged.
await this.interaction.reply({ content: content, ephemeral: ephemeral });
13 replies
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 8/27/2022 in #djs-questions
Should threadUpdate fire when threads are auto-archived?
I know some bots on djs v13 rely on this behavior. I'm on v14 and threadUpdate is seemingly not fired after 1 hour when the thread is auto-archived.
8 replies
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 8/18/2022 in #djs-questions
How do I check if user has permission to execute command
What the title says. I found ApplicationCommandPermissionsManager#has and tried it with
guilds.commands.permissions.has({ command: this.id, permissionId: member.id })
guilds.commands.permissions.has({ command: this.id, permissionId: member.id })
but all that method does is to check if that specific user has an override in the permissions. I want to check if the user's combined permissions (from all roles and individual overrides) are sufficient to invoke the command. Do I really have to iterate through every single channel in the guild and every single role on the user and call has() all those times to figure this out? Surely not, because that wouldn't even cover admin permissions AFAIK.
67 replies
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 8/15/2022 in #djs-questions
Wait until link or image embeds appears on message
On a messageCreate event, a message with a link that contains an embed does not have the embed data with it (as Discord hasn't resolved it yet). As soon as Discord resolves it (0.5-2 seconds), a messageUpdate event fires and the new message contains the embed data. Does DiscordJS have anything built in to await this embed update with a collector? I want an API similar to <Interaction>.awaitModalSubmit or <Message>.awaitReactions.
11 replies
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 8/15/2022 in #djs-questions
Is it possible to generate the default thread name from a message with djs?
56 replies
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 8/13/2022 in #djs-questions
Best way to stay in the same context with awaitModalSubmit?
When I use <CommandInteraction>.awaitModalSubmit(), does the filter automatically make sure that it's a modal that was opened in the same context as the command, in any way? If not, my idea was to filter on user and customId to make sure I stay in the same context, as seen below.
// assuming I invoked interaction.showModal() with customId = "modal" prior to this
// "member" is the member that invoked this command
await interaction.awaitModalSubmit({
time: 1000 * 60 * 5, // 5min
filter: x => x.customId === "modal" && x.member?.user.id === member.id,
});
// assuming I invoked interaction.showModal() with customId = "modal" prior to this
// "member" is the member that invoked this command
await interaction.awaitModalSubmit({
time: 1000 * 60 * 5, // 5min
filter: x => x.customId === "modal" && x.member?.user.id === member.id,
});
Is there a better way of achieving this?
17 replies
DIAdiscord.js - Imagine a bot
Created by LeMorrow on 8/11/2022 in #djs-questions
How can I consistently get the parent channel of a public thread?
45 replies