Skip to main content

Webhooks & Logging

RoleLogic can send notifications to Discord channels whenever roles change. This keeps your team informed and creates an audit trail of all automated actions.

What Are Webhook Logs?

A webhook log is a configured notification that sends messages to a Discord channel when RoleLogic changes a member's roles. You can customize:

  • Which channel receives notifications
  • What the message looks like
  • What information is included
  • The webhook's name and avatar

Setting Up a Webhook Log

Step 1: Grant Webhook Permissions

RoleLogic needs the "Manage Webhooks" permission in the channel where you want to send notifications.

To grant this:

  1. Go to the channel in Discord
  2. Click the gear icon to open Channel Settings
  3. Go to Permissions
  4. Find the RoleLogic role (or bot)
  5. Enable "Manage Webhooks"

Step 2: Create a Log Configuration

  1. In the RoleLogic dashboard, go to your server
  2. Find the Logs or Webhooks section
  3. Click "Create New Log" or "Add Webhook"

Step 3: Configure the Log

Select a Channel: Choose which Discord channel should receive notifications.

Set Webhook Name (Optional): Customize the name that appears as the sender. Default is "RoleLogic".

Set Avatar URL (Optional): Provide a URL to a custom avatar image. The webhook will use this icon.

Configure Message Content: Enter the message template. Use placeholders (see below) to include dynamic information.

Step 4: Attach to Rules

After creating a log, attach it to specific rules:

  1. Open a rule in the editor
  2. Find the "Log" or "Webhook" option
  3. Select your configured log
  4. Save the rule

Now, whenever that rule triggers, a notification is sent.

Dynamic Placeholders

Placeholders let you include dynamic information in your webhook messages. When the webhook fires, placeholders are replaced with actual values.

How to Use Placeholders

Type placeholders in curly braces within your message:

{user.mention} just got new roles!

This becomes:

@JohnDoe just got new roles!

Available Placeholders

User Information

PlaceholderDescriptionExample Output
{user.mention}Mentions the user@JohnDoe
{user.nickname}Server nicknameJohnDoe
{user.tag}Username#discriminatorJohnDoe#1234
{user.id}User's Discord ID123456789012345678
{user.avatar_url}URL to user's avatarhttps://cdn.discord...

Role Changes

PlaceholderDescriptionExample Output
{roles.added.names}Names of added rolesVIP, Premium
{roles.added.mentions}Mentions of added roles@VIP, @Premium
{roles.removed.names}Names of removed rolesGuest, Trial
{roles.removed.mentions}Mentions of removed roles@Guest, @Trial

Server Information

PlaceholderDescriptionExample Output
{server.name}Server nameMy Awesome Server
{server.id}Server ID987654321098765432
{server.member_count}Total members1,234
{server.icon_url}Server icon URLhttps://cdn.discord...
{server.description}Server descriptionWelcome to our community!
{server.banner_url}Server banner URLhttps://cdn.discord...
{server.vanity_url}Vanity invite URLdiscord.gg/myserver
{server.boost_count}Number of boosts15
{server.boost_tier}Boost level (0-3)2

Channel Information

PlaceholderDescriptionExample Output
{channel.name}Channel namerole-logs
{channel.mention}Channel mention#role-logs
{channel.topic}Channel topicLog channel for role changes
{channel.url}Link to channelhttps://discord.com/channels/...
{channel.category.name}Parent categoryAdmin Channels

Bot Information

PlaceholderDescriptionExample Output
{bot.nickname}Bot's server nicknameRoleLogic
{bot.mention}Bot mention@RoleLogic
{bot.avatar_url}Bot's avatar URLhttps://cdn.discord...

Time and Date

PlaceholderDescriptionExample Output
{time:short}Short time format3:45 PM
{time:long}Long time format3:45:30 PM
{date:short}Short date format01/15/2024
{date:long}Long date formatJanuary 15, 2024
{timestamp}Discord timestamp<t:1705329930>
{timestamp:r}Relative timestamp5 minutes ago

Placeholder Suggestions

When typing in the message editor, type { to see a dropdown of available placeholders. Select one to insert it into your message.

Example Webhook Messages

Simple Notification

🔔 **Role Update**
{user.mention} received: {roles.added.names}

Output:

🔔 Role Update @JohnDoe received: VIP, Premium

Detailed Log

**Member:** {user.tag}
**Added:** {roles.added.names}
**Removed:** {roles.removed.names}
**Time:** {timestamp}

Output:

Member: JohnDoe#1234 Added: VIP, Premium Removed: Guest Time: <t:1705329930>

Staff Alert

⚠️ Staff role change detected!

{user.mention} now has: {roles.added.mentions}
Processed by RoleLogic at {time:long}

Customizing Appearance

Webhook Username

Set a custom name for the webhook sender:

  • "RoleLogic" (default)
  • "Role Bot"
  • "Server Automation"
  • Your server's name

Webhook Avatar

Provide a URL to an image for the webhook's avatar. This could be:

  • Your server's logo
  • A custom bot icon
  • Any publicly accessible image URL

Accent Color

Set a color for embed messages (if using embeds):

  • Use a hex color code
  • Match your server's branding
  • Use different colors for different log types

Media Attachments

Include images or media in your webhook messages:

  • Provide a media URL
  • Useful for branded notifications
  • Can be positioned above or below content

Premium Features

Watermark Removal

Free plan webhook messages include a small RoleLogic watermark/branding. Premium plans remove this for clean, professional notifications.

Advanced Components

Premium unlocks advanced webhook features:

  • V2 component messages
  • Custom branding options
  • Enhanced media support

Managing Multiple Logs

You can create multiple webhook logs for different purposes:

  • Staff log: Detailed notifications in a staff channel
  • Public log: Simple notifications in a public channel
  • Audit log: Comprehensive records in a secure channel

Each log can have different configurations and be attached to different rules.

Tips for Effective Logging

Don't Over-Log

Sending too many notifications can be noisy. Consider:

  • Logging only important role changes
  • Using a dedicated channel that staff can mute
  • Consolidating logs where possible

Use Meaningful Messages

Include enough context that someone can understand what happened without investigating:

  • Who was affected
  • What roles changed
  • When it happened

Protect Sensitive Channels

Role change logs might contain information about moderation actions. Consider:

  • Using private staff channels
  • Limiting who can see the log channel
  • Not logging sensitive rule triggers publicly

Review Logs Periodically

Webhook logs create a record of all automated actions. Review them to:

  • Verify rules are working correctly
  • Spot unexpected patterns
  • Audit automation behavior

Troubleshooting

"No Webhook Perms"

RoleLogic doesn't have "Manage Webhooks" permission in the target channel. Grant this permission through channel settings.

Messages Not Appearing

  1. Verify the channel exists and is accessible
  2. Check RoleLogic has permissions in that channel
  3. Confirm the log is attached to an enabled rule
  4. Verify the rule is actually triggering

Placeholders Showing Raw

If you see {user.mention} instead of an actual mention:

  • Check for typos in the placeholder
  • Ensure you're using the correct placeholder format
  • Try removing and re-adding the placeholder

Next Steps