if (interaction.customId == "guildmodalcreate") {
const member = interaction.member
let channel = interaction.guild.channels.cache.find(channel => channel.name === "Имя" && channel.type === "GUILD_CATEGORY")
?.children
.find(channel => channel.name === `|${interaction.user.username}`)
console.log(channel)
в любом случае. let channel = interaction.guild.channels.cache.find(channel => channel.name === "Имя && channel.type === ChannelType.GuildCategory)
^
TypeError: Cannot read properties of undefined (reading 'GuildCategory')
if (interaction.customId == "guildmodalcreate") {
const member = interaction.member
let channel = interaction.guild.channels.cache.find(channel => channel.name === "Имя" && channel.type === "GUILD_CATEGORY")
?.children
.find(channel => channel.name === `|${interaction.user.username}`)
if (!channel) {}
Cannot read properties of undefined (reading '0') args
const Discord = require("discord.js");
exports.run = async (client, message, args) => {
let attach = message.attachments.map(x => x.proxyURL)[0]
if(!attach) attach = ""
const ModEmbed = new Discord.MessageEmbed()
.setDescription("Ку-ку! Пришла картинка на модерацию! Проверьте ее.")
.setImage(attach)
client.channels.cache.get('866701909867233340').send(ModEmbed)
await message.react('').then(() => message.react(''));
const filter = (reaction, user) => {
return ['', ''].includes(reaction.emoji.name) && user.id === message.author.id;
};
message.awaitReactions(filter, { max: 1 })
.then(collected => {
const reaction = collected.first();
if (!user.bot && reaction.emoji.name === '') {
message.reply('Изображение успешно опубликовано!');
const GodEmbed = new Discord.MessageEmbed()
.setTitle("Кто-то поделился картинкой!")
.setImage(attach)
client.channels.cache.get('866701909867233340').send(GodEmbed)
} else {
message.reply('Вы отменили публикацию.');
}
})
.catch(collected => {
message.channel.send('Что блять.');
});
}
exports.help = {
name: "gramm"
}
const Discord = require("discord.js");
exports.run = (client, message, args) => {
let attach = message.attachments.map(x => x.proxyURL)[0]
if(!attach) attach = ""
const ModEmbed = new Discord.MessageEmbed()
.setDescription("Ку-ку! Пришла картинка на модерацию! Проверьте ее.")
.setImage(attach)
client.channels.cache.get('866701909867233340').send(ModEmbed)
await.react('').then(() => message.react(''));
const filter = (reaction, user) => {
return ['', ''].includes(reaction.emoji.name) && user.id === message.author.id;
};
message.awaitReactions(filter, { max: 1, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (!user.bot && reaction.emoji.name === '') {
message.reply('Изображение успешно опубликовано!');
const GodEmbed = new Discord.MessageEmbed()
.setTitle("Кто-то поделился картинкой!")
.setImage(attach)
client.channels.cache.get('866701909867233340').send(GodEmbed)
} else {
message.reply('Вы отменили публикацию.');
}
})
.catch(collected => {
message.channel.send('Что блять.');
});
}
exports.help = {
name: "gramm"
}
По сути он теперь ставит реакции, но не отслеживает их.