Error executing control
ReferenceError: ComponentType is not defined
const embed1 = new EmbedBuilder()
.setTitle("Управление пользователя")
.setColor(0x08f300)
.addFields(
{ name: 'Участник', value: `<@${member.user.id}>`, inline: true },
{ name: 'Дата регистрации', value: `<t:${Math.round(member.user.createdTimestamp / 1000)}>`, inline: true },
{ name: 'Присоединился к серверу', value: `<t:${Math.round(member.joinedAt / 1000)}>`, inline: true },
)
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('ban')
.setLabel('Забанить')
.setEmoji(``)
.setStyle(ButtonStyle.Danger),
new ButtonBuilder()
.setCustomId('unban')
.setLabel('Разбанить')
.setEmoji(``)
.setStyle(ButtonStyle.Success),
new ButtonBuilder()
.setCustomId('mute')
.setLabel('Мут')
.setEmoji(``)
.setStyle(ButtonStyle.Danger),
new ButtonBuilder()
.setCustomId('unmute')
.setLabel('Размут')
.setEmoji(``)
.setStyle(ButtonStyle.Success),
);
await interaction.reply({ components: [row], embeds: [embed1] });
const message = await interaction.fetchReply();
const collector = message.createMessageComponentCollector({ componentType: ComponentType.Button, time: 15000, filter: i => i.user.id === interaction.member.id });
collector.on("collect", i => {
if (i.customId === "ban") {
const member = interaction.options.getMember("target");
const role = interaction.guild.roles.cache.get("1075876710832152616");
member.roles.add(role);
}
})}};
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, Events, SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require('discord.js');
const client = require('discord.js');
const interactionCreate = require('../events/interactionCreate');
module.exports = {
data: new SlashCommandBuilder()
.setName('control')
.setDescription('Управление пользователем')
.addUserOption(option =>
option
.setName('target')
.setDescription('Пользователь, кем вы хотите управлять')
.setRequired(true))
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers, PermissionFlagsBits.KickMembers)
.setDMPermission(false),
async execute(interaction) {
const member = await interaction.guild.members.fetch(interaction.options.getUser("target").id);
const embed1 = new EmbedBuilder()
.setTitle("Управление пользователя")
.setColor(0x08f300)
.addFields(
{ name: 'Участник', value: `<@${member.user.id}>`, inline: true },
{ name: 'Дата регистрации', value: `<t:${Math.round(member.user.createdTimestamp / 1000)}>`, inline: true },
{ name: 'Присоединился к серверу', value: `<t:${Math.round(member.joinedAt / 1000)}>`, inline: true },
)
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('ban')
.setLabel('Забанить')
.setEmoji(``)
.setStyle(ButtonStyle.Danger),
new ButtonBuilder()
.setCustomId('unban')
.setLabel('Разбанить')
.setEmoji(``)
.setStyle(ButtonStyle.Success),
new ButtonBuilder()
.setCustomId('mute')
.setLabel('Мут')
.setEmoji(``)
.setStyle(ButtonStyle.Danger),
new ButtonBuilder()
.setCustomId('unmute')
.setLabel('Размут')
.setEmoji(``)
.setStyle(ButtonStyle.Success),
);
await interaction.reply({ components: [row], embeds: [embed] });
const message = await interaction.fetchReply();
const collector = message.createMessageComponentCollector({ componentType: ComponentType.Button, time: 15000, filter: i => i.user.id === interaction.member.id });
collector.on("collect", i => {
if (i.customId === "ban") {
const role = interaction.options.getRole('1075876710832152616');
const member = interaction.options.getMember(target);
member.roles.add(role);
}
})}};
await interaction.reply({ components: [row], embeds: [embed] });
const message = await interaction.fetchReply();
const collector = message.createMessageComponentCollector({ componentType: ComponentType.Button, time: 15000, filter: i => i.user.id === interaction.member.id });
collector.on("collect", i => {
if (i.customId === "customId_ban") {
const role = interaction.options.getRole('1075876710832152616');
const member = interaction.options.getMember('target');
member.roles.add(role);
}
})
})
SyntaxError: Unexpected end of input