Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
Estoy tratando de hacer roles de reacción usando mi propio bot de discordia pero por alguna razón no agrega el rol a pesar de que agrega las reacciones.

Estoy tratando de hacer un bot de discordia que agregue roles a partir de las reacciones. He estado siguiendo un tutorial de CodeLyon y tengo un inconveniente y no puedo encontrar una solución.

Básicamente, conseguí que el bot enviara un mensaje incrustado y agregara las reacciones al mensaje. Pero no agrega los roles.

 module.exports = { name: "reactionrole", description: "Sets up a reaction role message!", async execute(message, args, Discord, client) { const channel = "907732565685846036"; const ACRole = message.guild.roles.cache.find( (role) => role.name === "Animal Crossing" ); const ACEmoji = "🐸"; let embed = new Discord.MessageEmbed() .setColor("#e42643") .setTitle("Choose which games you play!") .setDescription( "React to add the games you play as a role (and receive pings)\n\n" + `${ACEmoji} for Animal Crossing\n` ); let messageEmbed = await message.channel.send({ embeds: [embed] }); messageEmbed.react(ACEmoji); client.on("messageReactionAdd", async (reaction, user) => { if (reaction.message.partial) await reaction.message.fetch(); if (reaction.partial) await reaction.fetch(); if (user.bot) return; if (!reaction.message.guild) return; if (reaction.message.channel.id == channel) { if (reaction.emoji.name === ACEmoji) { await reaction.message.guild.members.cache .get(user.id) .roles.add(ACRole); } } else { return; } }); client.on("messageReactionRemove", async (reaction, user) => { if (reaction.message.partial) await reaction.message.fetch(); if (reaction.partial) await reaction.fetch(); if (user.bot) return; if (!reaction.message.guild) return; if (reaction.message.channel.id == channel) { if (reaction.emoji.name === ACEmoji) { await reaction.message.guild.members.cache .get(user.id) .roles.remove(ACRole); } } else { return; } }); }, };
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

En mi archivo main.js (algunas personas usan index.js) tuve que cambiar const client = new Discord.Client({ intents: ['GUILDS', 'GUILD_MESSAGES', 'GUILD_MESSAGE'] }, { partials: ["MESSAGE", "CHANNEL", "REACTION" ] })

a

const client = new Discord.Client({ intents: ['GUILDS', 'GUILD_MESSAGES', 'GUILD_MESSAGE_REACTIONS'] }, { partials: ["MESSAGE", "CHANNEL", "REACTION" ] })

Lo arregló un poco, pero al azar dejó de funcionar nuevamente.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda