edocsil
edocsil
DIAdiscord.js - Imagine an app
Created by Flinty on 8/22/2023 in #djs-questions
Slash Command redirect
When creating a message, apps must provide a value for at least one of content, embeds, sticker_ids, components, or files[n].
https://discord.com/developers/docs/resources/channel#create-message-jsonform-params
24 replies
DIAdiscord.js - Imagine an app
Created by Flinty on 8/22/2023 in #djs-questions
Slash Command redirect
You can also just send a message with only components. Content and embeds aren't required if you have components as the components are enough to not be empty
24 replies
DIAdiscord.js - Imagine an app
Created by clapii 𓆰𓆪 on 8/15/2023 in #djs-questions
kick cmd err?
I'd expect you to also get "unknown interaction" errors on your console when this happens
5 replies
DIAdiscord.js - Imagine an app
Created by clapii 𓆰𓆪 on 8/15/2023 in #djs-questions
kick cmd err?
"The application did not respond" is shown to the end user when your bot doesn't acknowledge the interaction within 3 seconds. This is because you're doing other stuff before trying to reply to the interaction. If you're going to make requests and such before responding you should deferReply() the interaction as soon as you know it will take extra time and then editReply() to update the message when done
5 replies
DIAdiscord.js - Imagine an app
Created by Atom Skully on 8/3/2023 in #djs-questions
Emojis on SelectMenu
The value should literally be '🤖'
14 replies
DIAdiscord.js - Imagine an app
Created by Atom Skully on 8/3/2023 in #djs-questions
Emojis on SelectMenu
Twemojis
14 replies
DIAdiscord.js - Imagine an app
Created by beck on 8/2/2023 in #djs-questions
don't know how to go about getting rid of this
Sometimes building it with if statements is a good starting point instead of jumping to using short circuits and other things that are less obvious to read
26 replies
DIAdiscord.js - Imagine an app
Created by beck on 8/2/2023 in #djs-questions
don't know how to go about getting rid of this
So if there's a custom status you want the title to just be the status, otherwise "playing <thing>"?
26 replies
DIAdiscord.js - Imagine an app
Created by beck on 8/2/2023 in #djs-questions
don't know how to go about getting rid of this
Activity.type isn't an array either so I'm not surprised that this isn't evaluating correctly
activities[memberActivity?.type[0]] || 'playing '
activities[memberActivity?.type[0]] || 'playing '
26 replies
DIAdiscord.js - Imagine an app
Created by beck on 8/2/2023 in #djs-questions
don't know how to go about getting rid of this
26 replies
DIAdiscord.js - Imagine an app
Created by beck on 8/2/2023 in #djs-questions
don't know how to go about getting rid of this
Activity.state is the text of the custom status
26 replies
DIAdiscord.js - Imagine an app
Created by nBux on 7/31/2023 in #djs-questions
Can I edit an embed in a different channel when clicking a button?
You do still also need to respond to the button interaction or it will show an error to the user
9 replies
DIAdiscord.js - Imagine an app
Created by edocsil on 7/31/2023 in #djs-questions
Disabling threads sweeper
Okay cool, thank you for confirming
4 replies
DIAdiscord.js - Imagine an app
Created by edocsil on 7/31/2023 in #djs-questions
Disabling threads sweeper
My use case is that I have a function that relies on all threads in a forum being cached. The only way I can think of to make sure that the list is always there is to fetch them each time, but that means some redundant API requests if the function is called again too soon and while the threads are still cached. Hoping that disabling the sweeper would let me fetch the threads once the first time the function is called and then never again for the rest of the session
4 replies
DIAdiscord.js - Imagine an app
Created by Honie on 7/28/2023 in #djs-questions
Creating a modal after a button click shows an "Unknown Interaction" error
What you saw about not being able to defer modal submits is correct, however I don't think it actually has an effect on what you are trying to do in this case
11 replies
DIAdiscord.js - Imagine an app
Created by Honie on 7/28/2023 in #djs-questions
Creating a modal after a button click shows an "Unknown Interaction" error
collector?.on('collect', async (i) => {
// Remove previous info
i.deferUpdate();
msgInt.editReply({ components: [] });
collector.stop();

// Buttons
for (let component of currentSetup.components) {
if (component.id === i.customId) {
// Modals
if (component.modal) {
const modal = await this.createModal(component.modal, i);
return;
}
}
}
})
collector?.on('collect', async (i) => {
// Remove previous info
i.deferUpdate();
msgInt.editReply({ components: [] });
collector.stop();

// Buttons
for (let component of currentSetup.components) {
if (component.id === i.customId) {
// Modals
if (component.modal) {
const modal = await this.createModal(component.modal, i);
return;
}
}
}
})
I'm not clear why you're calling i.deferUpdate() when the rest of the code before interaction.showModal() shouldn't take long to execute. You should be able to just remove that line without any issue. Calling collector.stop() also seems redundant since it has a max of 1 and would end anyways
11 replies
DIAdiscord.js - Imagine an app
Created by TheShyPeridot on 7/27/2023 in #djs-questions
I have a issue where if my bot is turned off and back on it isnt catching who is leaving at all
Can you be more specific than "didn't work"?
6 replies
DIAdiscord.js - Imagine an app
Created by TheShyPeridot on 7/27/2023 in #djs-questions
I have a issue where if my bot is turned off and back on it isnt catching who is leaving at all
Event won't emit when the member isn't cached. You can change that by enabling the GuildMembers partial but note that member.user.tag will probably not work when member.partial is true
6 replies
DIAdiscord.js - Imagine an app
Created by Massicraft on 7/26/2023 in #djs-questions
How to make a slash command that disable/enables other slash commands?
You can add and delete commands but you really shouldn't be doing that frequently. Command availability is better managed by server moderators through the server settings, and you can set default permissions for them to use as a starting point
4 replies
DIAdiscord.js - Imagine an app
Created by Massicraft on 7/26/2023 in #djs-questions
How to make a slash command that disable/enables other slash commands?
For what purpose?
4 replies