(node:788) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
at Client.<anonymous> (/home/dcoder/music-bot-master/bot.js:38:44)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:788) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:788) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
message.channel.send(exampleEmbed).then(async message => {
await message.react('✅');
await message.delete({timeout:15000});
const filter = (reaction, user) => reaction.emoji.name === '✅' && user.id === message.author.id;
const collector = message.createReactionCollector(filter, { max: 1, time: 15000000 });
collector.on('collect', r => {
const successEmbed = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle('Действие успешно подтвержденно')
.setDescription(`Вополняемое действие: **${message.content}**\nПользователь: <@${message.author.id}> `)
.addFields(
{ name: 'ℹ Действие успешно подтвержденно', value: '\u200B'},
)
.setTimestamp()
.setFooter('Ferrera Family Bot', 'https://i.imgur.com/lXm2MJf.png');
message.channel.send(successEmbed)
});
collector.on('end', collected => console.log('1'));
});
client.on("ready", () => {
client.user.setActivity(`Текст`, {type: 'LISTENING'});
});
const client = new Discord.Client();
, а не const bot = new Discord.Client();
поэтому мне это не очень поможет.bot.user.setPresence({
^
ReferenceError: bot is not defined
at Object.<anonymous> (C:\Users\User\Desktop\Discord Bot\bot.js:14:3)
[90m at Module._compile (internal/modules/cjs/loader.js:1256:30)[39m
[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)[39m
[90m at Module.load (internal/modules/cjs/loader.js:1105:32)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:967:14)[39m
[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)[39m
[90m at internal/main/run_main_module.js:17:47[39m
Т.е. у человека есть роль Сапорт, он может вызвать действие при нажатии на реакцию.
А человек без роли Сапорт не может вызвать действие при нажатии на реакцию.