NNKtv28
NNKtv28
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 9/27/2023 in #djs-questions
How can i setup a ticket system with a parent category?
deploy-ticket.js code:
const { SlashCommandBuilder } = require('discord.js');
const { MessageActionRow, MessageSelectMenu, MessageEmbed } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('deploy-ticket')
.setDescription('Deploy a button to open a ticket channel')
.addChannelOption((option) => // Use the addChannelOption method
option.setName('parent_category')
.setDescription('The parent category of the ticket channel')
.setType('GUILD_CATEGORY')
.setRequired(false) // Optional
),

async execute(interaction) {
// Create an action row to contain the select menu
const row = new MessageActionRow().addComponents(parentCategorySelect);

// Create an embed to provide information about the ticket system
const embed = new MessageEmbed()
.setColor('#0099ff')
.setTitle('Ticket System')
.setDescription('Select a parent category from the dropdown menu and click the "Open Ticket" button to create a new support ticket.');

// Create a button that users can click to open a ticket
const ticketButton = new MessageButton()
.setCustomId('open_ticket')
.setLabel('Open Ticket')
.setStyle('PRIMARY');

// Send the embed with the select menu and button
await interaction.reply({ embeds: [embed], components: [row], files: [], components: [ticketButton] });
},
};
const { SlashCommandBuilder } = require('discord.js');
const { MessageActionRow, MessageSelectMenu, MessageEmbed } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('deploy-ticket')
.setDescription('Deploy a button to open a ticket channel')
.addChannelOption((option) => // Use the addChannelOption method
option.setName('parent_category')
.setDescription('The parent category of the ticket channel')
.setType('GUILD_CATEGORY')
.setRequired(false) // Optional
),

async execute(interaction) {
// Create an action row to contain the select menu
const row = new MessageActionRow().addComponents(parentCategorySelect);

// Create an embed to provide information about the ticket system
const embed = new MessageEmbed()
.setColor('#0099ff')
.setTitle('Ticket System')
.setDescription('Select a parent category from the dropdown menu and click the "Open Ticket" button to create a new support ticket.');

// Create a button that users can click to open a ticket
const ticketButton = new MessageButton()
.setCustomId('open_ticket')
.setLabel('Open Ticket')
.setStyle('PRIMARY');

// Send the embed with the select menu and button
await interaction.reply({ embeds: [embed], components: [row], files: [], components: [ticketButton] });
},
};
303 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 9/27/2023 in #djs-questions
I get a weird error when executing deploy-commands.js
error i get:
Error deploying commands:
TypeError: command.data.toJSON is not a function
Started refreshing 12 application (/) commands.
Successfully reloaded 12 application (/) commands.
Error deploying commands:
TypeError: command.data.toJSON is not a function
Started refreshing 12 application (/) commands.
Successfully reloaded 12 application (/) commands.
40 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 9/27/2023 in #djs-questions
I dont know what this error means
the error:
E:\Discord bots\Custom bot order\events\connect.js:2
const chalk = require("chalk");
^

Error [ERR_REQUIRE_ESM]: require() of ES Module E:\Discord bots\Custom bot order\node_modules\chalk\source\index.js from E:\Discord bots\Custom bot order\events\connect.js not supported.
Instead change the require of index.js in E:\Discord bots\Custom bot order\events\connect.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (E:\Discord bots\Custom bot order\events\connect.js:2:15)
at Object.<anonymous> (E:\Discord bots\Custom bot order\index.js:35:17) {
code: 'ERR_REQUIRE_ESM'
}

Node.js v18.18.0
E:\Discord bots\Custom bot order\events\connect.js:2
const chalk = require("chalk");
^

Error [ERR_REQUIRE_ESM]: require() of ES Module E:\Discord bots\Custom bot order\node_modules\chalk\source\index.js from E:\Discord bots\Custom bot order\events\connect.js not supported.
Instead change the require of index.js in E:\Discord bots\Custom bot order\events\connect.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (E:\Discord bots\Custom bot order\events\connect.js:2:15)
at Object.<anonymous> (E:\Discord bots\Custom bot order\index.js:35:17) {
code: 'ERR_REQUIRE_ESM'
}

Node.js v18.18.0
connect.js code:
17 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 9/25/2023 in #djs-questions
MongoDB cant get an item to be added to a shop schema
No description
4 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 7/26/2023 in #djs-questions
Need help with subcommands
i cant figure how to get this subcommand right, its the info command and it has the user and the server subcommands
35 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 7/26/2023 in #djs-questions
Need help with setting up a Role option in a slash command
im tryna make a command to specify a income role, when i try to start the bot i get this error:
/home/container/node_modules/@sapphire/shapeshift/dist/index.js:47
throw this.error;
^
ExpectedConstraintError: Invalid string format
at Object.run (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:1587:64)
at /home/container/node_modules/@sapphire/shapeshift/dist/index.js:207:66
at Array.reduce (<anonymous>)
at StringValidator.parse (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:207:29)
at validateName (/home/container/node_modules/@discordjs/builders/dist/index.js:1384:17)
at SlashCommandRoleOption.setName (/home/container/node_modules/@discordjs/builders/dist/index.js:1468:5)
at /home/container/commands/Administration/setup-income-roles.js:8:39
at MixedClass._sharedAddOptionMethod (/home/container/node_modules/@discordjs/builders/dist/index.js:2008:50)
at MixedClass.addRoleOption (/home/container/node_modules/@discordjs/builders/dist/index.js:1963:17)
at Object.<anonymous> (/home/container/commands/Administration/setup-income-roles.js:8:6) {
constraint: 's.string.regex',
given: 'Role',
expected: 'expected /^[\\p{Ll}\\p{Lm}\\p{Lo}\\p{N}\\p{sc=Devanagari}\\p{sc=Thai}_-]+$/u.test(expected) to be true'
}
Node.js v19.0.0
/home/container/node_modules/@sapphire/shapeshift/dist/index.js:47
throw this.error;
^
ExpectedConstraintError: Invalid string format
at Object.run (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:1587:64)
at /home/container/node_modules/@sapphire/shapeshift/dist/index.js:207:66
at Array.reduce (<anonymous>)
at StringValidator.parse (/home/container/node_modules/@sapphire/shapeshift/dist/index.js:207:29)
at validateName (/home/container/node_modules/@discordjs/builders/dist/index.js:1384:17)
at SlashCommandRoleOption.setName (/home/container/node_modules/@discordjs/builders/dist/index.js:1468:5)
at /home/container/commands/Administration/setup-income-roles.js:8:39
at MixedClass._sharedAddOptionMethod (/home/container/node_modules/@discordjs/builders/dist/index.js:2008:50)
at MixedClass.addRoleOption (/home/container/node_modules/@discordjs/builders/dist/index.js:1963:17)
at Object.<anonymous> (/home/container/commands/Administration/setup-income-roles.js:8:6) {
constraint: 's.string.regex',
given: 'Role',
expected: 'expected /^[\\p{Ll}\\p{Lm}\\p{Lo}\\p{N}\\p{sc=Devanagari}\\p{sc=Thai}_-]+$/u.test(expected) to be true'
}
Node.js v19.0.0
8 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 7/25/2023 in #djs-questions
Need help with Economy system using slash commands and redis database
Im trying to make a command called give-items that only members with admin permission can use, when
10 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 7/23/2023 in #djs-questions
Im getting an error that i dont know how to solve
error:
TypeError: Cannot read properties of undefined (reading 'get')
at change_status (/home/container/events/client/ready.js:56:68)
at module.exports (/home/container/events/client/ready.js:33:5)
at Client.emit (node:events:525:35)
at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:387:17)
at WebSocketManager.checkShardsReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:370:10)
at WebSocketShard.<anonymous> (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:200:16)
at WebSocketShard.emit (node:events:513:28)
at WebSocketShard.checkReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:181:12)
at WebSocketShard.gotGuild (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:155:10)
at WebSocketManager.<anonymous> (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:240:15)
TypeError: Cannot read properties of undefined (reading 'get')
at change_status (/home/container/events/client/ready.js:56:68)
at module.exports (/home/container/events/client/ready.js:33:5)
at Client.emit (node:events:525:35)
at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:387:17)
at WebSocketManager.checkShardsReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:370:10)
at WebSocketShard.<anonymous> (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:200:16)
at WebSocketShard.emit (node:events:513:28)
at WebSocketShard.checkReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:181:12)
at WebSocketShard.gotGuild (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:155:10)
at WebSocketManager.<anonymous> (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:240:15)
11 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 7/23/2023 in #djs-questions
Can anyone help me with the discord intents
i dont know what this error means:
/home/container/index.js:40
intents: [Discord.Intents.FLAGS.GUILDS,
^
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.<anonymous> (/home/container/index.js:40:29)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
at node:internal/main/run_main_module:23:47
/home/container/index.js:40
intents: [Discord.Intents.FLAGS.GUILDS,
^
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.<anonymous> (/home/container/index.js:40:29)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
at node:internal/main/run_main_module:23:47
72 replies
DIAdiscord.js - Imagine an app
Created by NNKtv28 on 4/12/2023 in #djs-questions
Need help with an error idk what it is
i get a weird error and idk what it is
11 replies