الـنَّـهْـشَـلُ
الـنَّـهْـشَـلُ
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/5/2023 in #djs-questions
embedbuilder is not working ...
it worked
11 replies
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/5/2023 in #djs-questions
embedbuilder is not working ...
ahaaaa thx thx
11 replies
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/5/2023 in #djs-questions
embedbuilder is not working ...
so its interaction.user.username ?
11 replies
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/5/2023 in #djs-questions
embedbuilder is not working ...
it gives me undefined
11 replies
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/5/2023 in #djs-questions
embedbuilder is not working ...
11 replies
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/4/2023 in #djs-questions
embed message setcolor is not working
okaaayyy ... thx thx
4 replies
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/4/2023 in #djs-questions
ModalBuilder() is not working !
okay nvm i solved it i imported "ModalBuilder" from "@discordjs/builders" and i should import it from "discord.js"
5 replies
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/4/2023 in #djs-questions
ModalBuilder() is not working !
i tried to see the discord.js docs and it doesnt work with me too
if (interaction.commandName === "userregister") {

console.log('hello world register !');
// Create the modal
const modal = new ModalBuilder()
.setCustomId('myModal')
.setTitle('My Modal');

// Add components to modal

// Create the text input components
const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
// The label is the prompt the user sees for this input
.setLabel("What's your favorite color?")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);

const hobbiesInput = new TextInputBuilder()
.setCustomId('hobbiesInput')
.setLabel("What's some of your favorite hobbies?")
// Paragraph means multiple lines of text.
.setStyle(TextInputStyle.Paragraph);

// An action row only holds one text input,
// so you need one action row per text input.
const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);
const secondActionRow = new ActionRowBuilder().addComponents(hobbiesInput);

// Add inputs to the modal
modal.addComponents(firstActionRow, secondActionRow);

await interaction.showModal(modal);
if (interaction.commandName === "userregister") {

console.log('hello world register !');
// Create the modal
const modal = new ModalBuilder()
.setCustomId('myModal')
.setTitle('My Modal');

// Add components to modal

// Create the text input components
const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
// The label is the prompt the user sees for this input
.setLabel("What's your favorite color?")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);

const hobbiesInput = new TextInputBuilder()
.setCustomId('hobbiesInput')
.setLabel("What's some of your favorite hobbies?")
// Paragraph means multiple lines of text.
.setStyle(TextInputStyle.Paragraph);

// An action row only holds one text input,
// so you need one action row per text input.
const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);
const secondActionRow = new ActionRowBuilder().addComponents(hobbiesInput);

// Add inputs to the modal
modal.addComponents(firstActionRow, secondActionRow);

await interaction.showModal(modal);
error:
node:events:491
throw er; // Unhandled 'error' event
^

Error: Cannot properly serialize component type: undefined
at createComponentBuilder (file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1140:13)
at file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1187:54
at Array.map (<anonymous>)
at new ActionRowBuilder (file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1187:35)
at file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1281:76
at Array.map (<anonymous>)
at ModalBuilder.addComponents (file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1280:37)
at Client.<anonymous> (file:///C:/Users/kura/Desktop/slash_tutorial/src/index.js:73:19)
at Client.emit (node:events:513:28)
at InteractionCreateAction.handle (C:\Users\kura\Desktop\slash_tutorial\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

Node.js v18.16.0
[nodemon] app crashed - waiting for file changes before starting...
node:events:491
throw er; // Unhandled 'error' event
^

Error: Cannot properly serialize component type: undefined
at createComponentBuilder (file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1140:13)
at file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1187:54
at Array.map (<anonymous>)
at new ActionRowBuilder (file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1187:35)
at file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1281:76
at Array.map (<anonymous>)
at ModalBuilder.addComponents (file:///C:/Users/kura/Desktop/slash_tutorial/node_modules/@discordjs/builders/dist/index.mjs:1280:37)
at Client.<anonymous> (file:///C:/Users/kura/Desktop/slash_tutorial/src/index.js:73:19)
at Client.emit (node:events:513:28)
at InteractionCreateAction.handle (C:\Users\kura\Desktop\slash_tutorial\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

Node.js v18.16.0
[nodemon] app crashed - waiting for file changes before starting...
5 replies
DIAdiscord.js - Imagine an app
Created by الـنَّـهْـشَـلُ on 7/4/2023 in #djs-questions
ModalBuilder() is not working !
import { Client, GatewayIntentBits, Routes, ActionRowBuilder, TextInputStyle } from 'discord.js';
import { SelectMenuBuilder, ModalBuilder, TextInputBuilder} from '@discordjs/builders'
import { REST } from '@discordjs/rest';
import OrderCommand from './commands/order.js';
import RolesCommand from './commands/roles.js';
import UsersCommand from './commands/user.js';
import ChannelsCommand from './commands/channels.js';
import BanCommand from './commands/ban.js';
import RegisterCommand from './commands/user_register.js';
import { Client, GatewayIntentBits, Routes, ActionRowBuilder, TextInputStyle } from 'discord.js';
import { SelectMenuBuilder, ModalBuilder, TextInputBuilder} from '@discordjs/builders'
import { REST } from '@discordjs/rest';
import OrderCommand from './commands/order.js';
import RolesCommand from './commands/roles.js';
import UsersCommand from './commands/user.js';
import ChannelsCommand from './commands/channels.js';
import BanCommand from './commands/ban.js';
import RegisterCommand from './commands/user_register.js';
this is my imports
5 replies