#I get an error

1 messages · Page 1 of 1 (latest)

zealous flare

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

module.exports = {
data: new SlashCommandBuilder()
.setName('hallo')
.setDescription('Begrüßungsnachricht'),
async execute(interaction) {
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('unique-id')
.setLabel('Click Me')
.setStyle(1)
);

    const embed = new EmbedBuilder()
        .setColor('#0099ff')
        .setTitle('Welcome!')
        .setDescription('This is a welcome message with an embedded button.');

    await interaction.reply({ content: 'Hello!', embeds: [embed], components: [row] });

    const filter = i => i.customId === 'unique-id' && i.user.id === interaction.user.id;
    const collector = interaction.channel.createMessageComponentCollector({ filter, time: 15000 });

    collector.on('collect', async () => {

const guild = interaction.guild;
const category = guild.channels.cache.find(c => c.type === 'GUILD_CATEGORY' && c.name === 'Bot-Developing');

    guild.channels.create('new-channel', {
        type: 'GUILD_TEXT',
        parent: '1185290034962771998'
    });
    });
},

};