i am tring to do that every time someone that joins my server blocks dms the bot will open a channel and send a verify link instead of a dm what I stuck on (store the channel and stuff like that)
client.on('guildMemberAdd', member => { const linkId = pool.createLink(member.id); const embed = new Discord.MessageEmbed() .setTitle('reCAPTCHA Verification') .setDescription(`To gain access to this server you must solve a captcha. The link will expire in 15 minutes.\nhttp://${domain == '' ? 'localhost:8050' : domain}/verify/${linkId}`) .setColor('YELLOW'); channel = client.channels.cache.get(`${logschannel}`); channel.send('user has joined if you dont get another message in a few minutes please check if the user has verifyed '); member.send(embed).catch(() => {message.guild.channels .create(member.id, { type: "text" }), channel.send('@here'); const errore = new Discord.MessageEmbed() .setTitle('reCAPTCHA Verification') .setDescription(`The user with the id ${member.id} is blocking dms please check on that!`) .setColor('RED') channel.send(errore)})
what I had
client.on('guildMemberAdd', member => { const linkId = pool.createLink(member.id); const embed = new Discord.MessageEmbed() .setTitle('reCAPTCHA Verification') .setDescription(`To gain access to this server you must solve a captcha. The link will expire in 15 minutes.\nhttp://${domain == '' ? 'localhost:8050' : domain}/verify/${linkId}`) .setColor('YELLOW'); channel = client.channels.cache.get(`${logschannel}`); channel.send('user has joined if you dont get another message in a few minutes please check if the user has verifyed '); member.send(embed).catch(() => {channel.send('@here'); const errore = new Discord.MessageEmbed() .setTitle('reCAPTCHA Verification') .setDescription(`The user with the id ${member.id} is blocking dms please check on that!`) .setColor('RED') channel.send(errore)})
https://stackoverflow.com/questions/65546537/create-a-channel-on-catch-error-instead-of-dms January 03, 2021 at 12:06PM
没有评论:
发表评论