SzyMoon
SzyMoon
DIAdiscord.js - Imagine an app
Created by SzyMoon on 12/16/2023 in #djs-questions
DeferReply problem
You are right. ok i didnt reload my code it works like this.
await interaction.deferUpdate()
await interaction.editReply({components:[]});
await interaction.followUp({content:"test"})
await interaction.deferUpdate()
await interaction.editReply({components:[]});
await interaction.followUp({content:"test"})
It's a shame that bot doesnt show that works to update something Thank you once again!
14 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 12/16/2023 in #djs-questions
DeferReply problem
Yup i messed up order. It works like this
await interaction.deferReply();
await interaction.deferUpdate({components: []})
await interaction.editReply({content: 'This is a follow-up message.'});
await interaction.deferReply();
await interaction.deferUpdate({components: []})
await interaction.editReply({content: 'This is a follow-up message.'});
Thank you so much for help!
14 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 12/16/2023 in #djs-questions
DeferReply problem
deferUpdate also throws error already replied
14 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 12/16/2023 in #djs-questions
DeferReply problem
interaction update deletes components under clicked message in that case, i cant editReply that i think. Or am i wrong?
14 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 12/16/2023 in #djs-questions
DeferReply problem
Sure thing but when i do update first then editReply i got Code:
await interaction.deferReply();
await new Promise(resolve => setTimeout(resolve, 5000));

await interaction.update({components: []})
await interaction.editReply({content: 'This is a follow-up message.');
await interaction.deferReply();
await new Promise(resolve => setTimeout(resolve, 5000));

await interaction.update({components: []})
await interaction.editReply({content: 'This is a follow-up message.');
Error:
Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ButtonInteraction.update (D:\Lief\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:225:46)
at Object.execute (D:\Lief\handlers\button\test.js:16:27)
at async Client.<anonymous> (D:\Lief\index.js:209:9) {
code: 'InteractionAlreadyReplied'
Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ButtonInteraction.update (D:\Lief\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:225:46)
at Object.execute (D:\Lief\handlers\button\test.js:16:27)
at async Client.<anonymous> (D:\Lief\index.js:209:9) {
code: 'InteractionAlreadyReplied'
14 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 10/28/2023 in #djs-questions
User.client.presence is null
That's so smart! Thank you so much! Case closed
10 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 10/28/2023 in #djs-questions
User.client.presence is null
That works! Thank you! I have got one question. Can i get clientStatus of user in DM or not? There is no GatewayIntentBit of DMPresences as far as i know in documentation
10 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 10/28/2023 in #djs-questions
User.client.presence is null
of the user who uses this command I want to know if user is on mobile version or desktop
10 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 10/28/2023 in #djs-questions
User.client.presence is null
Yup! Still nothing
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildPresences,
10 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 8/11/2023 in #djs-questions
Modal imput question
Thank you for your answer!
4 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 8/11/2023 in #djs-questions
Modal imput question
And code is here if you want to look up
const modal = new ModalBuilder()
.setCustomId('contact-form')
.setTitle('Dane kontaktowe');

const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
// The label is the prompt the user sees for this input
.setLabel("What's your favorite color?")
// Short means only a single line of text
.setStyle(1);

const select = new StringSelectMenuBuilder()
.setCustomId('starter')
.setPlaceholder('Make a selection!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Bulbasaur')
.setDescription('The dual-type Grass/Poison Seed Pokémon.')
.setValue('bulbasaur'),
new StringSelectMenuOptionBuilder()
.setLabel('Charmander')
.setDescription('The Fire-type Lizard Pokémon.')
.setValue('charmander'),
new StringSelectMenuOptionBuilder()
.setLabel('Squirtle')
.setDescription('The Water-type Tiny Turtle Pokémon.')
.setValue('squirtle'),
);


const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);
const secondActionRow = new ActionRowBuilder().addComponents(select);
modal.addComponents(firstActionRow,secondActionRow);

await interaction.showModal(modal);

})
const modal = new ModalBuilder()
.setCustomId('contact-form')
.setTitle('Dane kontaktowe');

const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
// The label is the prompt the user sees for this input
.setLabel("What's your favorite color?")
// Short means only a single line of text
.setStyle(1);

const select = new StringSelectMenuBuilder()
.setCustomId('starter')
.setPlaceholder('Make a selection!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Bulbasaur')
.setDescription('The dual-type Grass/Poison Seed Pokémon.')
.setValue('bulbasaur'),
new StringSelectMenuOptionBuilder()
.setLabel('Charmander')
.setDescription('The Fire-type Lizard Pokémon.')
.setValue('charmander'),
new StringSelectMenuOptionBuilder()
.setLabel('Squirtle')
.setDescription('The Water-type Tiny Turtle Pokémon.')
.setValue('squirtle'),
);


const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);
const secondActionRow = new ActionRowBuilder().addComponents(select);
modal.addComponents(firstActionRow,secondActionRow);

await interaction.showModal(modal);

})
4 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 5/20/2023 in #djs-questions
Stage Bot
Thank you for your help! Just as i thought unfortunatelly. |Back to waiting for discord to fix their app ...
7 replies
DIAdiscord.js - Imagine an app
Created by SzyMoon on 5/8/2023 in #djs-questions
ForumChannel webhook scope
Oh my god... It didnt work for me because i was giving both threadName and threadId at the same time and it was causing error To create new thread you give ONLY threadName To send to specific thread you give it threadID Who knew?! Now i got it Thanks!
4 replies