How do I make the code?

const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName(`channelmsg`)
.setDescription("channel send msg")
.addChannelOption(option =>
option.setName('channel')
.setDescription('channel pick')
.setRequired(true))
.addStringOption(option =>
option.setName('msg')
.setDescription('pick')
.setRequired(true)
.addChoices(
{ name: '1', value: 'msg1' },
{ name: '2', value: 'msg2' },
{ name: '3', value: 'msg3' },
{ name: '4', value: 'msg4' }
)),

async execute(interaction, client) {
await interaction.reply({
components: [
]
});
},
};
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName(`channelmsg`)
.setDescription("channel send msg")
.addChannelOption(option =>
option.setName('channel')
.setDescription('channel pick')
.setRequired(true))
.addStringOption(option =>
option.setName('msg')
.setDescription('pick')
.setRequired(true)
.addChoices(
{ name: '1', value: 'msg1' },
{ name: '2', value: 'msg2' },
{ name: '3', value: 'msg3' },
{ name: '4', value: 'msg4' }
)),

async execute(interaction, client) {
await interaction.reply({
components: [
]
});
},
};
I want to select a channel and make it send a message to that channel.
4 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
probablyraging
What's wrong with the code you provided?
박준서
박준서OP2y ago
I don't know how to make the code because I don't understand JavaScript.
probablyraging
Then I recommend learning JavaScript before attempting to use DJS. This server isn't for teaching people JavaScript or writing their code for them
Want results from more Discord servers?
Add your server