I am eagerly awaiting responses to a message. The member begins typing, then the bot responds, and the user is expected to react to the bot's message. I attempted to execute this code, however, when it reached the console.log("OK"), nothing happened. (Apologies for the Hungarian code)
if (message.channel.id === "714071018733568031" && !message.author.bot && !message.content.startsWith("!jovahagy")) { // ID
message.author.send("Thank you for responding! We will confirm shortly! Please wait.")
const Discord = require('discord.js');
const embedMsg = new Discord.MessageEmbed()
embedMsg.setColor('ee00ff')
embedMsg.setTitle('Join Request')
embedMsg.setAuthor('KraftBOT', 'https://s1.bozaiakos.hu/tkomprofile.jpg', 'https://magentakraft.hu')
embedMsg.setDescription('Someone wants to join the server and has responded to the question!')
embedMsg.addField('Applicant', `${message.author}`)
embedMsg.addField('Message', `${message.content}`)
embedMsg.addField('\u200B', '\u200B')
embedMsg.addField('Approval', `!jovahagy ${message.author}`)
embedMsg.addField('Rejection', `!elutasit ${message.author}`)
embedMsg.setFooter('Bozai Ákos - Professional servers, bots, websites.', 'https://bozaiakos.hu/images/logokor.png');
message.delete();
client.channels.cache.get("714071028925464586").send({embed: embedMsg}) // ID
.then(nMessage => {nMessage.react('✅').then(r => {
nMessage.react('❎');
});
// First argument is a filter function
nMessage.awaitReactions((reaction, user) => user.id == message.author.id && (reaction.emoji.name == '✅' || reaction.emoji.name == '❎'),
{ max: 1 }).then(collected => {
if (collected.first().emoji.name == '✅') {
const accepted = message.author;
if (!accepted.roles.cache.some(r => r.name === "Verification in progress")) {
nMessage.delete();
} else {
console.log("OK");
try {
var role = message.guild.roles.cache.find(role => role.name === "Member");
accepted.roles.add(role);
var role = message.guild.roles.cache.find(role => role.name === "Verification in progress");
accepted.roles.remove(role);
} catch (error) {return;}
accepted.send(`${message.author} has approved you on the MagentaKraft server. You can now chat.`)
const Discord = require('discord.js');
const embedMsg = new Discord.MessageEmbed()
embedMsg.setColor('00ff11')
embedMsg.setTitle('Join Approved')
embedMsg.setAuthor('KraftBOT', 'https://s1.bozaiakos.hu/tkomprofile.jpg', 'https://magentakraft.hu')
embedMsg.setDescription('A member's joining request has been accepted.')
embedMsg.addField('Approved Member', `${accepted}`,true)
embedMsg.addField('Approved by', `${message.author}`,true)
embedMsg.addField('Applicant Response', `${message.content}`)
embedMsg.setFooter('Bozai Ákos - Professional servers, bots, websites.', 'https://bozaiakos.hu/images/logokor.png');
client.channels.cache.get("714071038962696262").send({embed: embedMsg});
nMessage.delete();
}
}
else if (collected.first().emoji.name == '❎') {
const accepted = message.author;
if (!accepted.roles.cache.some(r => r.name === "Verification in progress")) {
nMessage.delete();
} else {
accepted.send(`${message.author} has rejected you on the MagentaKraft server. Please contact us for details! Common reasons for rejection include: \n- Incorrect name (e.g. starts with a symbol)
\n- Non-serious application text (spelling errors, off-topic, etc.)`)
const Discord = require('discord.js');
const embedMsg = new Discord.MessageEmbed()
embedMsg.setColor('ff0000')
embedMsg.setTitle('Join Rejected')
embedMsg.setAuthor('KraftBOT', 'https://s1.bozaiakos.hu/tkomprofile.jpg', 'https://magentakraft.hu')
embedMsg.setDescription('A member's joining request has been rejected.')
embedMsg.addField('Rejected Member', `${accepted}`,true)
embedMsg.addField('Rejected by', `${message.author}`,true)
embedMsg.addField('Applicant Response', `${message.content}`)
embedMsg.setFooter('Bozai Ákos - Professional servers, bots, websites.', 'https://bozaiakos.hu/images/logokor.png');
client.channels.cache.get("714071039004508220").send({embed: embedMsg});
try {
accepted.kick();
} catch (error) {return;}
nMessage.delete();
}
}
})
What steps should I take next? I have reviewed everything, including my roles, but there was no action when I reacted with a check mark.