SAMMI Stuff

Find all the information you need to set up Deck Hopper and my extensions for your SAMMI.

Random Bunny

SAMMI Extensions

Discord Triggers

Get on Ko-fi
Slide 1

The video above shows the following features that are no longer available due to changes in Discord API: User started/stopped speaking, OBS Overlay

Discord Triggers is an extension that allows you to receive Discord events in SAMMI, such as new messages, reactions, new members, or when someone joins/leaves your voice channel.

Features

  • Connect to your Discord server and listen to all available events.
  • Premade deck with example buttons: Get started quickly with a premade deck that includes example triggers for the most common events.

Available Events

  • Servers - server updated, channel created, role deleted, etc.
  • Moderation - member banned, member unbanned, etc.
  • Voice State - user joined/left voice channel, muted, unmuted, started streaming, etc.
  • Messages - channel and direct message created/modified/deleted, reaction added/removed, etc.
  • Events - event created/updated/deleted, user joined event, etc.
  • Polls - poll created/updated/deleted, user voted, etc.

For all available events, refer to the Discord Documentation.


Setup

  1. Install the extension. You can follow the Extension Install Guide.
  2. Open the Settings button and follow the instructions below.

Setup before Opening Connection

Please set up the Settings button before opening a connection. Save this button and completely reload Bridge if you change any values here.

Discord Triggers Settings

  • Discord Bot Token: Your Discord bot token. Must be in the server.
  • Server ID: Server ID you invited your bot to.
  • User ID: Your own Discord user ID.

How to Create a Discord App and Retrieve Bot Token

  1. Create a new application at Discord Developer Portal.
  2. Go to your new application, select Bot -> Reset token -> Copy and paste it into the 'Discord Bot Token' box in the Settings button in SAMMI.
  3. Still in 'Bot' menu, check all 3 intents under 'Privileged Gateway Intents'.
  4. Go to OAuth2 -> URL Generator -> Select Bot -> Click 'Copy' button (no need to select any additional permissions).
  5. Paste the URL into your browser, select the server you want to invite the bot to, and click 'Authorize'.

How to Retrieve Discord Server ID

  1. Enable developer mode in Discord:
    • Open Discord User Settings -> Advanced -> Enable Developer Mode.
  2. Right-click on the sidebar icon of your server -> Copy ID.

How to Retrieve Discord User ID

  1. Enable developer mode in Discord:
    • Open Discord User Settings -> Advanced -> Enable Developer Mode.
  2. Left-click on your profile in Discord.
  3. Click on Copy User ID.

How to Retrieve Discord Channel ID

  1. Enable developer mode in Discord:
    • Open your Discord User Settings -> Advanced -> Enable Developer Mode.
  2. Right-click on the channel name in your sidebar Discord -> Copy ID.

Intents Settings

  • Check all the intents (events) you wish to listen to.

Default Enabled Intents

  • Guilds: Create/Update/Delete server, channel, thread, pings, etc.
  • Members: Add/Update/Remove server user.
  • Moderation: Ban/Unban server user, Create audit entry.
  • Voice States: Member joins voice channel, mutes, unmutes, etc. (Required to join voice channels).
  • Messages: Create/Update/Delete message.
  • Message Reactions: Add/Remove message reaction.
  • Direct Messages: Create/Update/Delete DM.
  • Direct Message Reactions: Add/Remove DM reaction.
  • Message Content: Allows seeing message content.
  • Scheduled Events: Create/Update/Delete/Add/Remove User from a scheduled event.

How to Enable/Disable Intents

  • If you wish to modify the intents you're listening to, check/uncheck the boxes inside the Discord Intents Settings commands.

How to Listen to Events

There are dozens of different events you can listen to. This premade deck has several different examples to get you started. Simply navigate to the buttons and try them out.

Find all events by using the Intent Calculator.

Your bot must have the correct permissions, you must be listening to the correct intent, and you must be connected at all times.

  1. Select the Intent type in the left menu of the calculator. Ensure your bot has the permissions (explained in the previous steps).
  2. See all available events in the right menu.
  3. Click on the event that interests you to navigate to the Discord documentation.
  4. Check out what data the event returns.
  5. Build your button accordingly:
    • The extension trigger you need to attach to the button will be Discord Triggers EVENTNAME.
    • The trigger pull data will be the payload from Discord documentation for that event.
    • For example, to listen to all new messages:
      1. Use the Intents Calculator, select GUILD_MESSAGES -> Click on MESSAGE_CREATE to open the documentation.
      2. The extension trigger will be: Discord Triggers Message Create.
      3. The Pull Data will be the inner payload, which is a message object.
      4. The message object contains a 'content' key, which you can use as a pull value to grab the message contents.

Open/Close Connection Buttons

Use Open Connection button to open a new connection to listen to Discord events.
Bridge must be connected at all times, and the connection opened to receive events.

  • Action: Select Open Connection to start listening to events.
  • Leave the other boxes as they are.

Use Close Connection button to close the connection to Discord, which means your bot will go offline.


Get Information About a User, Channel, or Server by ID

Sometimes Discord events only return an ID for entities, such as users, channels, roles, or scheduled events.

The "Get Info by ID" command accepts the ID and returns the whole entity. Please review the examples of returned data inside the button in

Get Help

Please see Troubleshooting for common extensions issues.

Previous
Discord to Twitch & YouTube Relay