> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melonly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord Triggers

> Learn what starts each Discord trigger and what data it provides.

***

Discord Triggers start workflows when something happens in your connected Discord server.\
They can react to slash commands, members joining or leaving, role changes, moderation events and invite activity.

<Frame caption="A Discord trigger in a workflow">
  <img className="block" src="https://mintcdn.com/melonly/Icf-MhWcCce5bv5F/images/Dashboard/Workflows/wf-discord-trigger.png?fit=max&auto=format&n=Icf-MhWcCce5bv5F&q=85&s=2107b57ea99ad5151377c631b6e2d8e4" alt="A User Joins VC trigger connected to an Online Staff Count block and a Send Discord Message action" style={{ borderRadius: '0.75rem' }} width="1918" height="989" data-path="images/Dashboard/Workflows/wf-discord-trigger.png" />
</Frame>

***

## Blocks

<Tabs>
  <Tab title="Commands">
    ## Commands

    <Card title="Custom Slash Command">
      Starts the workflow when someone uses a custom slash command created for the workflow.

      **Configuration**

      * **Command Name**: The name of the slash command. It must use lowercase letters and numbers with no spaces.
      * **Command Description**: The description shown in Discord when users browse slash commands.
      * **Options**: Custom command inputs. Each option has a name, description and type.
      * **Required Discord Roles**: The Discord roles allowed to run the command. If multiple roles are selected, the user only needs one of them. Leave this blank to allow all users.

      **Option Types**

      * **Text**: A text value.
      * **Player**: A Roblox player username or ID. Partial usernames match the closest player in-game.
      * **User**: A Discord user.
      * **Number**: A number.
      * **Boolean**: A true or false value.
      * **Channel**: A Discord channel name or ID. Partial names match the closest channel.
      * **Discord Role**: A Discord role name or ID. Partial names match the closest role.

      **Output**

      * **Command Name**: The name of the command that was used.
      * **Invoking User**: The user who ran the command. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.
      * **Channel**: The Discord channel where the command was used. This output includes the channel ID and name.
      * Any custom command options configured for the trigger. Command options are optional.

      **Use it when**

      * You want users or staff to start a workflow from Discord.
      * The workflow needs values such as a player, reason, action or other command input.
    </Card>
  </Tab>

  <Tab title="Members">
    ## Members

    <Card title="Joined Discord Server">
      Starts the workflow when a user joins the connected Discord server.

      This trigger also runs when a bot joins the server.

      **Output**

      * **User**: The user who joined. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.

      **Use it when**

      * A workflow should run when someone joins the Discord server.
      * You want to send a custom welcome message or record the join in another system.
    </Card>

    <Card title="Left Discord Server">
      Starts the workflow when a user leaves the connected Discord server.

      This trigger also runs when a bot leaves the server.

      **Output**

      * **User**: The user who left. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.

      **Use it when**

      * A workflow should clean up data or notify staff after someone leaves.
    </Card>
  </Tab>

  <Tab title="Roles">
    ## Roles

    <Card title="Discord Role Given">
      Starts the workflow when a Discord role is added to a user.

      This trigger runs regardless of whether the role was added manually, by Melonly or by another bot.

      **Output**

      * **User**: The user who received the role. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.
      * **Role**: The Discord role that was added. This output includes the role ID and name.

      **Use it when**

      * A workflow should run when a specific Discord role is added.
      * You want to send a message or start another action after the role change.
    </Card>

    <Card title="Discord Role Removed">
      Starts the workflow when a Discord role is removed from a user.

      This trigger runs regardless of whether the role was removed manually, by Melonly or by another bot.

      **Output**

      * **User**: The user who lost the role. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.
      * **Role**: The Discord role that was removed. This output includes the role ID and name.

      **Use it when**

      * A workflow should run when a specific Discord role is removed.
      * You want to send a message or start another action after the role change.
    </Card>
  </Tab>

  <Tab title="Moderation">
    ## Moderation

    <Card title="Kicked From Discord">
      Starts the workflow when a user is kicked from the Discord server.

      **Output**

      * **User**: The user who was kicked. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.
      * **Reason**: The audit log reason for the kick as a string. This may be empty if Discord cannot resolve one.

      **Use it when**

      * A workflow should log the kick or run another action after it happens.
    </Card>

    <Card title="Banned From Discord">
      Starts the workflow when a user is banned from the Discord server.

      **Output**

      * **User**: The user who was banned. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.
      * **Reason**: The audit log reason for the ban as a string. This may be empty if Discord cannot resolve one.

      **Use it when**

      * A workflow should log the ban or run another action after it happens.
    </Card>

    <Card title="Unbanned From Discord">
      Starts the workflow when a user is unbanned from the Discord server.

      **Output**

      * **User**: The user who was unbanned. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.

      **Use it when**

      * A workflow should update records or notify staff after an unban.
    </Card>
  </Tab>

  <Tab title="Invites">
    ## Invites

    <Card title="Discord Invite Created">
      Starts the workflow when a Discord invite is created.

      **Output**

      * **Channel**: The Discord channel the invite was created for. This output includes the channel ID and name.
      * **Code**: The invite code.
      * **Inviter**: The user who created the invite. This output includes Melonly ID, Discord ID, name, avatar, Discord roles, Melonly roles, Melonly server status, nickname, join date and Discord status.
      * **Max Uses**: The maximum number of times the invite can be used. `0` means unlimited uses.
      * **Temporary**: A boolean showing whether the invite grants temporary membership.
      * **Expiration Date**: The invite expiration date as an ISO 8601 UTC timestamp string, for example `2026-08-07T11:15:46.987Z`. Returns `N/A` when the invite does not expire.

      **Use it when**

      * A workflow should log newly created invites.
      * You want to track the invite channel, creator, usage limit, expiration date or temporary status.
    </Card>

    <Card title="Discord Invite Deleted">
      Starts the workflow when a Discord invite is deleted.

      This trigger runs when an invite is manually deleted, not when it expires automatically.

      **Output**

      * **Channel**: The Discord channel the invite belonged to. This output includes the channel ID and name.
      * **Code**: The deleted invite code.

      **Use it when**

      * A workflow should log when an invite code is deleted.
    </Card>
  </Tab>
</Tabs>

***

## Working With Discord Triggers

Discord triggers use events from the Discord server linked through your server's Discord Integration module. The Melonly Discord bot must be in the linked server. Giving it Administrator is the safest way to make sure all required permissions are available.

For setup instructions, see [Linking Your Server](/Dashboard/discordintegration/home#linking-your-server).

When using Discord triggers, keep in mind:

* Outputs: Connect trigger outputs such as User, Role, Channel, Code or Reason to later blocks.
* Slash Command Options: Custom slash command options become outputs that later blocks can use.
* Discord Integration: These triggers require a linked Discord server with the Melonly Discord bot added.

### Example Workflow Flow

1. Filip runs `/asset-request` and enters `New patrol vehicle livery` as the request, `Design Team` as the department and `true` for urgent.
2. The workflow reads the request, department, urgent status, invoking user and channel from the trigger.
3. The workflow posts the request in the selected department channel and adds the urgent review role when needed.
4. The workflow responds privately to Filip with `Request submitted.`

***

<Card title="Need help?" icon="headset" href="https://melonly.xyz/discord">
  Still have questions? Join our Discord server for support from the Melonly Team.
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.