the command is about asking for coins. and i want to get the amount of coins that the user asked from the ask.js to the interactionCreate.js. to get the amount i tried
module.exports = {
name: "ask",
description: "ask for money",
async execute(client, message, args, Discord, profileData) {
let amount = args[1]
amount.setCustomId(`amountID-${amount}`)
if (!amount) return message.reply("Please enter a valid amount")
if(isNaN(amount)) return message.reply("Please enter a valid amount!");
if(amount < 1) return message.reply("You have to ask at least for one coin!");
if (amount > 5000) return message.reply("You can\'t ask for more that 5000!");
const embed = new MessageEmbed()
.setColor("BLUE")
.setTitle(`${message.author.username} is asking!`)
.setDescription(`<:Hover_Bits:1019925128215277578>・${message.author.username} is asking for ${amount} coins!`);
const row1 = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId('pay')
.setLabel('Pay')
.setStyle('SECONDARY')
)
const replied = await message.channel.send({
embeds: [embed],
components: [row1],
})
}
}
and its saying:
TypeError: Cannot read properties of undefined (reading 'setCustomId')
and that is my interactionCreate.js
if (interaction.customId == 'pay') {
await interaction.deferUpdate()
const amount = split[1]
}
every help will be great