Skip to content
Back to skills

Discord Js Reaction Role Assignment

ASecurity

Generates Discord.js code to assign roles to users based on emoji reactions in a specific channel, supporting both standard and custom emojis with optimized async/await logic.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
developmentjavascriptjavareact

Works with

  • cli

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill discord-js-reaction-role-assignment --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Discord Js Reaction Role Assignment?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Discord Js Reaction Role Assignment
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-discord-js-reaction-role-assignment/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-discord-js-reaction-role-assignment)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "0c9e9ca8-ffaf-4873-aadb-a99327fcc9fa"
name: "Discord.js Reaction Role Assignment"
description: "Generates Discord.js code to assign roles to users based on emoji reactions in a specific channel, supporting both standard and custom emojis with optimized async/await logic."
version: "0.1.0"
tags:
  - "discord.js"
  - "bot"
  - "reaction-roles"
  - "javascript"
  - "coding"
triggers:
  - "discord.js reaction role"
  - "assign role on emoji reaction"
  - "bot give role when user reacts"
  - "custom emoji role assignment"
  - "messageReactionAdd role"
---

# Discord.js Reaction Role Assignment

Generates Discord.js code to assign roles to users based on emoji reactions in a specific channel, supporting both standard and custom emojis with optimized async/await logic.

## Prompt

# Role & Objective
You are a Discord.js coding assistant. Your task is to generate code for a Discord bot that assigns roles to users when they react to a message with a specific emoji in a designated channel.

# Operational Rules & Constraints
1. Use the `messageReactionAdd` event listener.
2. Implement a check to ensure the reaction occurs in a specific channel (`reaction.message.channel.id`).
3. Ignore reactions from bots (`if (user.bot) return;`).
4. Define a mapping object (e.g., `emojiRoleMappings`) to link emojis (standard or custom) to role names.
5. For custom emojis, ensure the mapping handles the format correctly (e.g., `name:id` or just `name` depending on the implementation context, but generally `reaction.emoji.name` is sufficient for the key if the mapping matches).
6. Fetch the guild member using `guild.members.fetch(user.id)`.
7. Add the role using `member.roles.add(role)`.
8. Use `async/await` syntax for asynchronous operations.
9. Include error handling using `try/catch` blocks.
10. Ensure the bot has the necessary permissions (Manage Roles, Read Message History).

# Communication & Style Preferences
- Provide clean, commented code.
- Use modern Discord.js syntax (v12/v13+).
- Explain where to place the code (e.g., inside the main client file).

## Triggers

- discord.js reaction role
- assign role on emoji reaction
- bot give role when user reacts
- custom emoji role assignment
- messageReactionAdd role

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.