MRParamz
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
Chhers i appriciate you so much
23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
hahahahahhahaha im lost your too cleaver
23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
i have no idea how to do that lol
23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
so im wondering how i can implument this with the string menus without making a mess
23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
sorry for the hassle
23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
yes
23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
if i wanna test it do i just change that one bit of code ? : } else if (interaction.isStringSelectMenu()) {
const { selectMenus } = client;
const { customId } = interaction;
const menu = selectMenus.get(customId);
if (!menu) return new Error(
There is no code for this Menu
);
try {
await menu.execute(interaction, client);
} catch (error) {
console.error(error);
}23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
When i use select menus i get a error saying : (node:2708) DeprecationWarning: BaseInteraction#isSelectMenu() is deprecated. Use BaseInteraction#isStringSelectMenu() instead.
(Use
node --trace-deprecation ...
to show where the warning was created)23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
nothing but say interaction faled no console log or anything, Here is the handle components code const { readdirSync } = require('fs')
module.exports = (client) => {
// Initialize the properties in the client object
client.buttons = new Map();
client.selectMenus = new Map();
client.modals = new Map();
client.handleComponents = async () => {
const componentsFolder = readdirSync(
./src/components
);
for (const folder of componentsFolder) {
const componentFiles = readdirSync(./src/components/${folder}
).filter(file => file.endsWith('.js'));
switch (folder) {
case "buttons":
for (const file of componentFiles) {
const button = require(../components/${folder}/${file}
);
client.buttons.set(button.data.name, button);
}
break;
case "selectMenus":
for (const file of componentFiles) {
const menu = require(../components/${folder}/${file}
);
client.selectMenus.set(menu.data.name, menu);
}
break;
case "modals":
for (const file of componentFiles) {
const modal = require(../components/${folder}/${file}
);
client.modals.set(modal.data.name, modal);
}
break;
default:
break;
}
}
}
}23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
ill show you
23 replies
DIAdiscord.js - Imagine an app
•Created by MRParamz on 8/7/2023 in #djs-questions
Does anyone know how to setup userselectmenu listeners?
The thing is does it manage it from this? } else if (interaction.isStringSelectMenu()) {
const { selectMenus } = client;
const { customId } = interaction;
const menu = selectMenus.get(customId);
if (!menu) return new Error(
There is no code for this Menu
);
try {
await menu.execute(interaction, client);
} catch (error) {
console.error(error);
}23 replies