larkx
larkx
DIAdiscord.js - Imagine an app
Created by larkx on 9/13/2023 in #djs-questions
docs not working
thank you
9 replies
DIAdiscord.js - Imagine an app
Created by larkx on 9/13/2023 in #djs-questions
docs not working
That works
9 replies
DIAdiscord.js - Imagine an app
Created by larkx on 9/13/2023 in #djs-questions
docs not working
oH
9 replies
DIAdiscord.js - Imagine an app
Created by larkx on 9/13/2023 in #djs-questions
docs not working
doesnt seem to work
9 replies
DIAdiscord.js - Imagine an app
Created by larkx on 9/13/2023 in #djs-questions
docs not working
website*
9 replies
DIAdiscord.js - Imagine an app
Created by larkx on 9/13/2023 in #djs-questions
docs not working
I guess i need to delete all my browser data to get it working lol
9 replies
DIAdiscord.js - Imagine an app
Created by larkx on 9/13/2023 in #djs-questions
docs not working
turns out im on a really old docs version
9 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
new issue… Why isn't my modal submission acknowledging? I recieve the data but the modal doesn't close on the clients side??
const modalSubmission = await selectedPrice.awaitModalSubmit({ time: 300000 });
const pcppURL = modalSubmission.fields.getTextInputValue('list')
console.log(pcppURL)
embed.setDescription('The list has been created.')
selectedPrice.editReply({ embeds: [embed], components: [], ephemeral: true })
modalSubmission.reply({ embeds: [embed], components: [], ephemeral: true })
const modalSubmission = await selectedPrice.awaitModalSubmit({ time: 300000 });
const pcppURL = modalSubmission.fields.getTextInputValue('list')
console.log(pcppURL)
embed.setDescription('The list has been created.')
selectedPrice.editReply({ embeds: [embed], components: [], ephemeral: true })
modalSubmission.reply({ embeds: [embed], components: [], ephemeral: true })
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
thank you thank you thank you
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
THANK YOU
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
of what happens
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
let me make a gif
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
No no, I get interaction failed before submitting
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
I haven't yet because I haven't gotten to that point
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
let row2 = new MessageActionRow()
.addComponents(
new MessageSelectMenu()
.setCustomId('addManagePrice')
.setPlaceholder('Select an price...')
.addOptions([
{ label: `${units[currency]}300`, value: '300' },
{ label: `${units[currency]}400`, value: '400' },
{ label: `${units[currency]}500`, value: '500' },
{ label: `${units[currency]}600`, value: '600' }
]),
);
interaction.editReply()
const selectResponseMsg = await interaction.editReply({ embeds: [embed], components: [row2], fetchReply: true, ephemeral: true })
const selectedPrice = await selectResponseMsg.awaitMessageComponent({ filter, componentType: 'SELECT_MENU', time: 60000 })
const price = selectedPrice.values

console.log(price)

const db = new QuickDB();
const listsDB = db.table('lists')
//listsDB.set(`${currency}.${}`)
}
let row2 = new MessageActionRow()
.addComponents(
new MessageSelectMenu()
.setCustomId('addManagePrice')
.setPlaceholder('Select an price...')
.addOptions([
{ label: `${units[currency]}300`, value: '300' },
{ label: `${units[currency]}400`, value: '400' },
{ label: `${units[currency]}500`, value: '500' },
{ label: `${units[currency]}600`, value: '600' }
]),
);
interaction.editReply()
const selectResponseMsg = await interaction.editReply({ embeds: [embed], components: [row2], fetchReply: true, ephemeral: true })
const selectedPrice = await selectResponseMsg.awaitMessageComponent({ filter, componentType: 'SELECT_MENU', time: 60000 })
const price = selectedPrice.values

console.log(price)

const db = new QuickDB();
const listsDB = db.table('lists')
//listsDB.set(`${currency}.${}`)
}
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Struggling with awaitMessageComponent
I'll send the whole thing
let embed = new MessageEmbed()
.setColor('#EDA920')

if(action == 'add') {
embed.setDescription('Choose what currency the list is in.')

let gbpButton = new MessageButton().setCustomId('gbp').setLabel('£ GBP').setStyle('PRIMARY')
let usdButton = new MessageButton().setCustomId('usd').setLabel('$ USD').setStyle('PRIMARY')
let eurButton = new MessageButton().setCustomId('eur').setLabel('€ EUR').setStyle('PRIMARY')

let row = new MessageActionRow().addComponents(gbpButton, usdButton, eurButton)
const btnResponseMsg = await interaction.reply({ embeds: [embed], components: [row], fetchReply: true, ephemeral: true })

const filter = (i) => i.user.id === interaction.user.id;
const selectedCurrency = await btnResponseMsg.awaitMessageComponent({ filter, componentType: 'BUTTON', time: 60000 })
const currency = selectedCurrency.customId
embed.setDescription('Select the price of the list.')

const units = {
'gbp': '£',
'usd': '$',
'eur': '€'
}
let embed = new MessageEmbed()
.setColor('#EDA920')

if(action == 'add') {
embed.setDescription('Choose what currency the list is in.')

let gbpButton = new MessageButton().setCustomId('gbp').setLabel('£ GBP').setStyle('PRIMARY')
let usdButton = new MessageButton().setCustomId('usd').setLabel('$ USD').setStyle('PRIMARY')
let eurButton = new MessageButton().setCustomId('eur').setLabel('€ EUR').setStyle('PRIMARY')

let row = new MessageActionRow().addComponents(gbpButton, usdButton, eurButton)
const btnResponseMsg = await interaction.reply({ embeds: [embed], components: [row], fetchReply: true, ephemeral: true })

const filter = (i) => i.user.id === interaction.user.id;
const selectedCurrency = await btnResponseMsg.awaitMessageComponent({ filter, componentType: 'BUTTON', time: 60000 })
const currency = selectedCurrency.customId
embed.setDescription('Select the price of the list.')

const units = {
'gbp': '£',
'usd': '$',
'eur': '€'
}
13 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Select Menu Collector
Still seem to be getting the issue
7 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/24/2022 in #djs-questions
Select Menu Collector
Sorry, I sent the wrong code.
const selectResponseMsg = await interaction.editReply({ embeds: [embed], components: [row], fetchReply: true, ephemeral: true })
const collector = selectResponseMsg.createMessageComponentCollector({ componentType: 'SELECTMENU', time: 60000 });

collector.on('collect', i => {
if (i.user.id === interaction.user.id) {
i.reply(`${i.user.id} chose ${i.customId}`);
} else {
i.reply({ content: `No.`, ephemeral: true });
}
});

collector.on('end', collected => {
console.log(`Collected ${collected.size} interactions.`);
});
const selectResponseMsg = await interaction.editReply({ embeds: [embed], components: [row], fetchReply: true, ephemeral: true })
const collector = selectResponseMsg.createMessageComponentCollector({ componentType: 'SELECTMENU', time: 60000 });

collector.on('collect', i => {
if (i.user.id === interaction.user.id) {
i.reply(`${i.user.id} chose ${i.customId}`);
} else {
i.reply({ content: `No.`, ephemeral: true });
}
});

collector.on('end', collected => {
console.log(`Collected ${collected.size} interactions.`);
});
7 replies
DIAdiscord.js - Imagine an app
Created by larkx on 8/22/2022 in #djs-questions
Issue with Modals
Okay, so i want to then edit the initial reply it sends however it says that the interaction has not been sent or deferred when I try use "submission.editReply"
21 replies