Renzo
Renzo
DIAdiscord.js - Imagine an app
Created by Renzo on 12/24/2023 in #djs-questions
Limiting interaction to a specific user
sorry, that was a silly question
9 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/24/2023 in #djs-questions
Limiting interaction to a specific user
thanks! now it works
9 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/24/2023 in #djs-questions
Limiting interaction to a specific user
i'm sorry but I don't understand. What would be the correct way to do it then?
9 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/13/2023 in #djs-questions
help with interaction
thanks!!!
16 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/13/2023 in #djs-questions
help with interaction
I made it work, I just edited the round1response message I added this before the if block
const prueba = await round1response.edit({
content:`${rival} seleccionó ...`,
components:[],
embeds:[]
}) //this is what i added

if(round1RivalInteraction.values[0] == 'envido'){ //first round envido

const envRow = new ActionRowBuilder()
.addComponents(envSelectResponse);

const userResponseMsg = await prueba.reply(
{
content:`${user} aceptas el ${round1RivalInteraction.values[0]}`,
components:[envRow],
}
);

const userResponseEnv = await userResponseMsg.awaitMessageComponent({collectorUserFilter,componentType:3,time:60000}); //now works

if(userResponseEnv.values[0] == 'acepto' ){
game.playEnvido(true);
}else if(userResponseEnv.values[0] == 'rechazo'){
game.playEnvido(false);
}else if(userResponseEnv.values[0] == 'envido'){ //envido envido
const prueba = await round1response.edit({
content:`${rival} seleccionó ...`,
components:[],
embeds:[]
}) //this is what i added

if(round1RivalInteraction.values[0] == 'envido'){ //first round envido

const envRow = new ActionRowBuilder()
.addComponents(envSelectResponse);

const userResponseMsg = await prueba.reply(
{
content:`${user} aceptas el ${round1RivalInteraction.values[0]}`,
components:[envRow],
}
);

const userResponseEnv = await userResponseMsg.awaitMessageComponent({collectorUserFilter,componentType:3,time:60000}); //now works

if(userResponseEnv.values[0] == 'acepto' ){
game.playEnvido(true);
}else if(userResponseEnv.values[0] == 'rechazo'){
game.playEnvido(false);
}else if(userResponseEnv.values[0] == 'envido'){ //envido envido
now I have a question, its necessary to edit the msg after getting a response from the user with the string select menu?
16 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/13/2023 in #djs-questions
help with interaction
${user} aceptas el ${round1RivalInteraction.values} Here is where i get the 'Failed interaction'
16 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/13/2023 in #djs-questions
help with interaction
This is the piece of code I'm having trouble with kin
16 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/13/2023 in #djs-questions
help with interaction
const round1response = await msgTable.reply(
{
content:`${rival} elige tu jugada:`,
components:[firstRoundRow],
embeds:[firstRoundEmbed]
}
);

const round1RivalInteraction = await round1response.awaitMessageComponent({ collectorRivalFilter, componentType: 3, time: 60000 });

const envSelectResponse= new StringSelectMenuBuilder()
.setCustomId('envResp')
.setPlaceholder('Select your response!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Acepto')
.setValue('acepto'),
new StringSelectMenuOptionBuilder()
.setLabel('No acepto')
.setValue('rechazo'),
new StringSelectMenuOptionBuilder()
.setLabel('Envido')
.setValue('envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Real envido')
.setValue('real envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Falta envido')
.setValue('falta envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Salir')
.setValue('salir'),
);

if(round1RivalInteraction.values[0] == 'envido'){ //first round envido

const envRow = new ActionRowBuilder()
.addComponents(envSelectResponse);

const userResponseMsg = await round1RivalInteraction.reply(
{
content:`${user} aceptas el ${round1RivalInteraction.values[0]}`,
components:[envRow],
}
);

const userResponseEnv = await userResponseMsg.awaitMessageComponent({collectorUserFilter,componentType:3,time:60000});//here is where it gets stucked

if(userResponseEnv.values[0] == 'acepto' ){
game.playEnvido(true);
}else if(userResponseEnv.values[0] == 'rechazo'){
game.playEnvido(false);
}else if(userResponseEnv.values[0] == 'envido'){ //envido envido

const envRow2 = new ActionRowBuilder()
const round1response = await msgTable.reply(
{
content:`${rival} elige tu jugada:`,
components:[firstRoundRow],
embeds:[firstRoundEmbed]
}
);

const round1RivalInteraction = await round1response.awaitMessageComponent({ collectorRivalFilter, componentType: 3, time: 60000 });

const envSelectResponse= new StringSelectMenuBuilder()
.setCustomId('envResp')
.setPlaceholder('Select your response!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Acepto')
.setValue('acepto'),
new StringSelectMenuOptionBuilder()
.setLabel('No acepto')
.setValue('rechazo'),
new StringSelectMenuOptionBuilder()
.setLabel('Envido')
.setValue('envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Real envido')
.setValue('real envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Falta envido')
.setValue('falta envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Salir')
.setValue('salir'),
);

if(round1RivalInteraction.values[0] == 'envido'){ //first round envido

const envRow = new ActionRowBuilder()
.addComponents(envSelectResponse);

const userResponseMsg = await round1RivalInteraction.reply(
{
content:`${user} aceptas el ${round1RivalInteraction.values[0]}`,
components:[envRow],
}
);

const userResponseEnv = await userResponseMsg.awaitMessageComponent({collectorUserFilter,componentType:3,time:60000});//here is where it gets stucked

if(userResponseEnv.values[0] == 'acepto' ){
game.playEnvido(true);
}else if(userResponseEnv.values[0] == 'rechazo'){
game.playEnvido(false);
}else if(userResponseEnv.values[0] == 'envido'){ //envido envido

const envRow2 = new ActionRowBuilder()
16 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/13/2023 in #djs-questions
help with interaction
const msgTable = await game.showTable(interaction);

await game.sendCardsTo(user, game.user);
await game.sendCardsTo(rival, game.rival);

let cardSelect = new StringSelectMenuBuilder()
.setCustomId('starter')
.setPlaceholder('Make a selection!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Primera carta')
.setValue('0'),
new StringSelectMenuOptionBuilder()
.setLabel('Segunda carta')
.setValue('1'),
new StringSelectMenuOptionBuilder()
.setLabel('Tercera carta')
.setValue('2'),
new StringSelectMenuOptionBuilder()
.setLabel('Envido')
.setValue('envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Real envido')
.setValue('real envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Falta envido')
.setValue('falta envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Truco')
.setValue('truco'),
new StringSelectMenuOptionBuilder()
.setLabel('Salir')
.setValue('salir'),
);

let firstRoundRow = new ActionRowBuilder()
.setComponents(cardSelect)

let firstRoundEmbed = new EmbedBuilder()
.setTitle('Primera mano!')
.setColor('#FFDE33')
.setDescription(`${user} vs ${rival} jugando un trucardo`);
const msgTable = await game.showTable(interaction);

await game.sendCardsTo(user, game.user);
await game.sendCardsTo(rival, game.rival);

let cardSelect = new StringSelectMenuBuilder()
.setCustomId('starter')
.setPlaceholder('Make a selection!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Primera carta')
.setValue('0'),
new StringSelectMenuOptionBuilder()
.setLabel('Segunda carta')
.setValue('1'),
new StringSelectMenuOptionBuilder()
.setLabel('Tercera carta')
.setValue('2'),
new StringSelectMenuOptionBuilder()
.setLabel('Envido')
.setValue('envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Real envido')
.setValue('real envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Falta envido')
.setValue('falta envido'),
new StringSelectMenuOptionBuilder()
.setLabel('Truco')
.setValue('truco'),
new StringSelectMenuOptionBuilder()
.setLabel('Salir')
.setValue('salir'),
);

let firstRoundRow = new ActionRowBuilder()
.setComponents(cardSelect)

let firstRoundEmbed = new EmbedBuilder()
.setTitle('Primera mano!')
.setColor('#FFDE33')
.setDescription(`${user} vs ${rival} jugando un trucardo`);
16 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/13/2023 in #djs-questions
help with interaction
the code gets inside the if block, if i put a console.log before the userResponseEnv the console.log runs, but it doesnt run after the userResponseEnv, its like it get stucked in that line
16 replies
DIAdiscord.js - Imagine an app
Created by Renzo on 12/13/2023 in #djs-questions
help with interaction
Hi, no i dont get any error in console
16 replies