'Why am I getting the error "interaction.isButton is not a function" when I use a dropdown menu?
I am using djs ^13.6.0 why is this happening? It always occurs when I interact with a dropdown menu. The same thing happens with buttons too. It says TypeError: interaction.isButton is not a function It would be great if you could help me Thanks! This is so dumb. fewquifhewqiuofhqwuiofhweiqhfiwqeoh fwioq hfewqoiu hfwiuqo hfiweouq hfioewq hfeuiowhfweuioqfhewqoiuhfewqoiu hfuweqoi hfeoiwqu hfeiowqu hfeowqi hfweqoi hfewuioqhfewoiquhfewoiquhfeiwouqhfiewohfweqiohfewqiohf qwieouhfiowqe
This is part of my code:
const sourcebin = require('sourcebin_js');
const Discord = require ('discord.js')
const disbut = require("discord.js");
module.exports = async (client, interaction) => {
var { guild, message, channel, member, user } = interaction;
const wait = require('util').promisify(setTimeout);
let row = new MessageActionRow()
.addComponents([
new MessageSelectMenu()
.setCustomId("MessageSelectMenu")
.setPlaceholder(`Click me to Control the ticket!`)
.addOptions(
{
value: "closeTicket",
label: "Close the ticket",
description: `Close this ticket & Delete it!`,
emoji: "🔒"
},
{
value: "transcriptTicket",
label: "Transcript the ticket",
description: `Makes a Chat-Transcript for this ticket!`,
emoji: "📝"
},
{
value: "pinTicket",
label: "Pin the ticket",
description: `Pins the ticket so it cannot be normally closed!`,
emoji: "📌"
}
)
.setMaxValues(1) //OPTIONAL, this is how many values you can have at each selection
.setMinValues(1) //OPTIONAL , this is how many values you need to have at each selection
])
if(interaction.customId == 'reloadPanel') {
if(!client.config.OWNER_ID.includes(interaction.user.id)) {
return interaction.reply({ content: `**Only the __Bot-Owners__ can do this!**`, ephemeral: true })
}
interaction.reply({ content: `**Reloaded the section!**`, ephemeral: true })
const msg = await interaction.channel.send(`**Panel Reloaded - *Message will be deleted in 1 sec to make the channel notified!***`)
msg.delete()
} if(interaction.isSelectMenu()){
var user = require('quick.db').fetch(`Ticketopener_${interaction.channel.id}`);
var tmsg = require('quick.db').fetch(`ticketmsg_${interaction.guild.id}`) || `__**Please Tell Us What You Need Help On!**__`;
if(interaction.values == `botAllinone`) {
const yes = new Discord.MessageEmbed()
.setTitle(`Sucessfuly Created Your Ticket!`)
.setURL(`https://decodersdev.tk`)
.setColor(`GREEN`)
const no = new Discord.MessageEmbed()
.setTitle(`You already have another ticket opened!`)
.setURL(`https://decodersdev.tk`)
.setFooter(`Close it first to make a new one!`)
.setColor(`RED`)
var adminRole = require('quick.db').fetch(`TicketAdminRole_${interaction.guild.id}`)
var cat = require('quick.db').fetch(`Ticketcat_${interaction.guild.id}`)
var nameer = `・〢clan-${interaction.user.username}`
var checkTickets = interaction.guild.channels.cache.find(c => c.name == nameer.split(' ').join('-').toLocaleLowerCase());
if (checkTickets) {
interaction.reply({ embeds: [no], ephemeral: true})
return
} else {
interaction.reply({ embeds: [yes], ephemeral: true})
}
interaction.guild.channels.create(`・〢clan-${interaction.user.username}`, {
permissionOverwrites: [{
id: interaction.user.id,
allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "ATTACH_FILES"]
},
{
id: require('quick.db').fetch(`TicketAdminRole_${interaction.guild.id}`),
allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "ATTACH_FILES"]
}, {
id: interaction.guild.roles.everyone,
deny: ["VIEW_CHANNEL"]
}
],
type: 'text',
parent: cat,
topic: `User ID: **${interaction.user.id}**\nTicket Type: **All-In-One**`
}).then(async function(channel) {
require('quick.db').set(`TicketControl_${channel.id}`, interaction.user.id);
require('quick.db').set(`Ticketopener_${channel.id}`, interaction.user.username);
channel.send({ content: `${interaction.user} <a:shinydot:906791400060903464> <@&${adminRole}> <a:shinydot:906791400060903464>`,
embeds:[new Discord.MessageEmbed()
.setAuthor(`Thanks for Ordering : Clan Bot`, interaction.user.displayAvatarURL())
.setTitle(`**${interaction.user.tag}** Hey, Thanks for ordering a Clan Bot.`)
.setDescription(`**__<a:yes:906785808940425267> Please Tell us all of those Informations! | Otherwise, We can't create your Bot Quickly!__** \n\n >>> <:join:906786246767038515> \`1 \`**What should be the Bot Name?**\n*(The Bot's Username)* \n\n <:join:906786246767038515> \`2 \`**What should be the PREFIX?**\n *(The Letter(s) Infront of each Command, e.g: \`!\`)* \n\n <:join:906786246767038515> \`3 \`**What should be the AVATAR?**\n*(The Bot's Profile Picture)* \n\n <:join:906786246767038515> \`4 \`**What should be the EMBED COLOR?**\n*(The Color on the Left Side of Embeds)* \n\n <:join:906786246767038515> \`5 \`**What should be the STATUS?**\n *(e.g: \`+help | DECΩDERS™\`)* \n\n <:join:906786246767038515> \`6 \`**What should be the STATUS TYPE?**\n*(\`PLAYING\` / \`WATCHING\` / \`LISTENING\` / \`STREAMING\` / \`COMPETING\`)* \n\n\n <:join:906786246767038515> **Do you have any wishes?**`)
.addFields([
{name: "**Price:**", value: `> \`7 Invites/ 1$ Per Month\``},
{name: "**__Payment Methods:__**", value: `**Invites**
[**Paypal**](https://www.paypal.com), [**Nitro**](https://discord.com/nitro)`}
])
.setColor("RANDOM")
],
components: [row]
}).then(msg => {
msg.pin();
});
})
} if(interaction.values == `botBackup`) {
const yes = new Discord.MessageEmbed()
.setTitle(`Sucessfuly Created Your Ticket!`)
.setURL(`https://decodersdev.tk`)
.setColor(`GREEN`)
const no = new Discord.MessageEmbed()
.setTitle(`You already have another ticket opened!`)
.setURL(`https://decodersdev.tk`)
.setFooter(`Close it first to make a new one!`)
.setColor(`RED`)
var adminRole = require('quick.db').fetch(`TicketAdminRole_${interaction.guild.id}`)
var cat = require('quick.db').fetch(`Ticketcat_${interaction.guild.id}`)
var nameer = `backup︲order-${interaction.user.id}`
var checkTickets = interaction.guild.channels.cache.find(c => c.name == nameer.split(' ').join('-').toLocaleLowerCase());
if (checkTickets) {
interaction.reply({ embeds: [no], ephemeral: true})
return
} else {
interaction.reply({ embeds: [yes], ephemeral: true})
}
interaction.guild.channels.create(`backup︲order-${interaction.user.id}`, {
permissionOverwrites: [{
id: interaction.user.id,
allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
},
{
id: require('quick.db').fetch(`TicketAdminRole_${interaction.guild.id}`),
allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
}, {
id: interaction.guild.roles.everyone,
deny: ["VIEW_CHANNEL"]
}
],
type: 'text',
parent: cat,
topic: `User ID: **${interaction.user.id}**\nTicket Type: **Back-Up**`
}).then(async function(channel) {
require('quick.db').set(`TicketControl_${channel.id}`, interaction.user.id);
require('quick.db').set(`Ticketopener_${channel.id}`, interaction.user.username);
channel.send({ content: `${interaction.user} <a:shinydot:906791400060903464> <@&${adminRole}> <a:shinydot:906791400060903464>`,
embeds:[new Discord.MessageEmbed()
.setAuthor(`Thanks for ordering: Backup bot`, interaction.user.displayAvatarURL())
.setTitle(`**${interaction.user.tag}** Hey, Thanks for ordering a Backup Bot.`)
.setDescription(`**We are only selling SRC of this bot! As hosting has been discontinued for this bot!`)
.addFields([
{name: "**Price:**", value: `> \`$3 SRC\``},
{name: "**__Payment Methods:__**", value: `> ***[Paypal](https://www.paypal.com/paypalme/), [Nitro](https://discord.com/nitro)***`}
])
.setColor("RANDOM")
],
components: [row]
}).then(msg => {
msg.pin();
});
})
} if(interaction.values == `botMusic`) {
const yes = new Discord.MessageEmbed()
.setTitle(`Sucessfuly Created Your Ticket!`)
.setURL(`https://decodersdev.tk`)
.setColor(`GREEN`)
const no = new Discord.MessageEmbed()
.setTitle(`You already have another ticket opened!`)
.setURL(`https://decodersdev.tk`)
.setFooter(`Close it first to make a new one!`)
.setColor(`RED`)
var adminRole = require('quick.db').fetch(`TicketAdminRole_${interaction.guild.id}`)
var cat = require('quick.db').fetch(`Ticketcat_${interaction.guild.id}`)
var nameer = `music︲order-${interaction.user.id}`
var checkTickets = interaction.guild.channels.cache.find(c => c.name == nameer.split(' ').join('-').toLocaleLowerCase());
if (checkTickets) {
interaction.reply({ embeds: [no], ephemeral: true})
return
} else {
interaction.reply({ embeds: [yes], ephemeral: true})
}
interaction.guild.channels.create(`music︲order-${interaction.user.id}`, {
permissionOverwrites: [{
id: interaction.user.id,
allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
},
{
id: require('quick.db').fetch(`TicketAdminRole_${interaction.guild.id}`),
allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
}, {
id: interaction.guild.roles.everyone,
deny: ["VIEW_CHANNEL"]
}
],
type: 'text',
parent: cat,
topic: `User ID: **${interaction.user.id}**\nTicket Type: **Music Bot**`
}).then(async function(channel) {
require('quick.db').set(`TicketControl_${channel.id}`, interaction.user.id);
require('quick.db').set(`Ticketopener_${channel.id}`, interaction.user.username);
channel.send({ content: `${interaction.user} <a:shinydot:906791400060903464> <@&${adminRole}> <a:shinydot:906791400060903464>`,
embeds:[new Discord.MessageEmbed()
.setAuthor(`Thanks for ordering: Music bot`, interaction.user.displayAvatarURL())
.setTitle(`**${interaction.user.tag}** Hey, Thanks for ordering a Music Bot.`)
.setDescription(`**We are only selling SRC of this bot! As hosting has been discontinued for this bot!`)
.addFields([
{name: "**Price:**", value: `> \`$2 SRC\``},
{name: "**__Payment Methods:__**", value: `> ***[Paypal](https://www.paypal.com/paypalme/), [Nitro](https://discord.com/nitro)***`}
])
.setColor("RANDOM")
],
components: [row]
}).then(msg => {
msg.pin();
});
})```
This is my error
```<rejected> TypeError: interaction.isSelectMenu is not a function
at module.exports (/home/runner/Imroid-retry/events/client/ticketstuff.js:48:32)
at Client.<anonymous> (/home/runner/Imroid-retry/handler/loadEvents.js:14:73)
at Client.emit (node:events:402:35)
at InteractionCreateAction.handle (/home/runner/Imroid-retry/node_modules/discord.js/src/client/actions/InteractionCreate.js:74:12)
at Object.module.exports [as INTERACTION_CREATE] (/home/runner/Imroid-retry/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/home/runner/Imroid-retry/node_modules/discord.js/src/client/websocket/WebSocketManager.js:351:31)
at WebSocketShard.onPacket (/home/runner/Imroid-retry/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/runner/Imroid-retry/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/runner/Imroid-retry/node_modules/discord.js/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (node:events:390:28)
at Receiver.receiverOnMessage (/home/runner/Imroid-retry/node_modules/discord.js/node_modules/ws/lib/websocket.js:1137:20)
at Receiver.emit (node:events:390:28)
at Receiver.dataMessage (/home/runner/Imroid-retry/node_modules/discord.js/node_modules/ws/lib/receiver.js:528:14)
at Receiver.getData (/home/runner/Imroid-retry/node_modules/discord.js/node_modules/ws/lib/receiver.js:446:17)
at Receiver.startLoop (/home/runner/Imroid-retry/node_modules/discord.js/node_modules/ws/lib/receiver.js:148:22)
at Receiver._write (/home/runner/Imroid-retry/node_modules/discord.js/node_modules/ws/lib/receiver.js:83:10)
} reason: interaction.isSelectMenu is not a function```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
