Yido
Yido
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Yido on 5/25/2024 in #djs-questions
the bot is not sending message when member joins
thank you
7 replies
DIAdiscord.js - Imagine an app
Created by Yido on 5/25/2024 in #djs-questions
the bot is not sending message when member joins
is there a way to get all the intents, im kinda new to discord.js i dont know how to that 😔
7 replies
DIAdiscord.js - Imagine an app
Created by Yido on 5/25/2024 in #djs-questions
the bot is not sending message when member joins
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.cache.get('1138787209735045191');
console.log("here")
channel.send("text-here!")
});
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.cache.get('1138787209735045191');
console.log("here")
channel.send("text-here!")
});
7 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/9/2024 in #djs-questions
Whenever my slash command gets used for 2 times it gives an error
const { ActionRowBuilder, Events, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');

module.exports = {
name: Events.ClientReady,
once: true,
execute(client) {
client.on(Events.InteractionCreate, async interaction => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === 'suggest') {
// Create the modal
const modal = new ModalBuilder()
.setCustomId('suggestionModal')
.setTitle('Suggestion Form');

// Add components to modal

// Create the text input components
const suggestion_input = new TextInputBuilder()
.setCustomId('suggestion_input')
// The label is the prompt the user sees for this input
.setLabel("Your suggestion")
// Short means only a single line of text
.setStyle(TextInputStyle.Paragraph);

// so you need one action row per text input.
const firstActionRow = new ActionRowBuilder().addComponents(suggestion_input);

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

// Show the modal to the user
await interaction.showModal(modal);

client.on(Events.InteractionCreate, async interaction => {
if (!interaction.isModalSubmit()) return;
await interaction.reply({ content: 'Your suggestion was received successfully!', ephemeral: true});
// Get the data entered by the user
const suggestion_input = interaction.fields.getTextInputValue('suggestion_input');
console.log(`${interaction.user.tag} || ${suggestion_input}`, );
});
}
});
},
};
const { ActionRowBuilder, Events, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');

module.exports = {
name: Events.ClientReady,
once: true,
execute(client) {
client.on(Events.InteractionCreate, async interaction => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === 'suggest') {
// Create the modal
const modal = new ModalBuilder()
.setCustomId('suggestionModal')
.setTitle('Suggestion Form');

// Add components to modal

// Create the text input components
const suggestion_input = new TextInputBuilder()
.setCustomId('suggestion_input')
// The label is the prompt the user sees for this input
.setLabel("Your suggestion")
// Short means only a single line of text
.setStyle(TextInputStyle.Paragraph);

// so you need one action row per text input.
const firstActionRow = new ActionRowBuilder().addComponents(suggestion_input);

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

// Show the modal to the user
await interaction.showModal(modal);

client.on(Events.InteractionCreate, async interaction => {
if (!interaction.isModalSubmit()) return;
await interaction.reply({ content: 'Your suggestion was received successfully!', ephemeral: true});
// Get the data entered by the user
const suggestion_input = interaction.fields.getTextInputValue('suggestion_input');
console.log(`${interaction.user.tag} || ${suggestion_input}`, );
});
}
});
},
};
6 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/9/2024 in #djs-questions
Whenever my slash command gets used for 2 times it gives an error
i did not understand what ı should do
6 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
thank you for everything
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
okays
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
is it possible to run the code with only execute(client) and without module.exports?
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
so all ı had to do was use module.exports?
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
now it works!
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
is it explained in the part you provided
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
i still did not understand how am ı gonna solve this problem
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
i created the event holder and also have putted the code inside index.js
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
i still dont understand what should ı do
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
can you give me a example
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
i have followed everything in the event handler guide (maybe did not read all of it)
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
i think yes but when i delete one of them the code gives the same "client is not defined" error
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 4/8/2024 in #djs-questions
i tried modals but it doesnt work
const {Client, ActionRowBuilder, Events, ModalBuilder, TextInputBuilder, TextInputStyle, GatewayIntentBits } = require('discord.js');

const Discord = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });



client.on(Events.InteractionCreate, async interaction => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === 'ping') {
// 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);

// Show the modal to the user
await interaction.showModal(modal);
}
});
const {Client, ActionRowBuilder, Events, ModalBuilder, TextInputBuilder, TextInputStyle, GatewayIntentBits } = require('discord.js');

const Discord = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });



client.on(Events.InteractionCreate, async interaction => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === 'ping') {
// 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);

// Show the modal to the user
await interaction.showModal(modal);
}
});
32 replies
DIAdiscord.js - Imagine an app
Created by Yido on 3/19/2024 in #djs-questions
i keep getting this error and i cannot find a solution
No description
13 replies
DIAdiscord.js - Imagine an app
Created by Yido on 3/19/2024 in #djs-questions
i keep getting this error and i cannot find a solution
i did install it
13 replies