Cover photo

How to Reward Points for Role Assignments in Discord

With Absinthe's API and Zapier, you can automatically reward users with points when they’re assigned a specific role on your Discord server. This guide will walk you through the setup process step-by-step.

Example Use Case

Imagine you want to recognize and reward members as they take on specific roles within your Discord server. You can easily set this up to automatically issue points whenever someone receives a particular role.

Step-by-Step Integration Guide

To implement this integration, you'll need a Zapier account and access to Absinthe's API. Follow these steps to create a seamless connection between Discord and your Absinthe points system.

1. Create a New Zap in Zapier

  • Log in to your Zapier account.

  • Click on "Create Zap" to start building your automation.

2. Set Discord as the Trigger App

  • Search for “Discord” in Zapier's app selection and choose it as the trigger app.

3. Select the ‘Role Assigned to User’ Event

  • From the list of available events, select “Role Assigned to User” as your trigger.

4. Connect Your Discord Account

  • If you haven’t connected your Discord account to Zapier yet, you’ll be prompted to do so. Follow the authorization prompts to grant access.

5. Choose the Discord Server to Monitor

  • Select the Discord server where you want to monitor role assignments for points rewards.

6. Test the Discord Trigger

  • Zapier will look for recent role assignments to test the trigger. If successful, continue to the next step.

7. Add Absinthe as the Action

  • Search for and select “Absinthe” in the action step.

  • You’ll need an invitation link to access Absinthe’s Zapier Action, which will be provided to you.

8. Configure the ‘Give Points’ Action

  • Under the Absinthe setup, choose “Give Points” as the Action Event.

9. Connect Your Absinthe Account

  • When prompted, enter your API key to authenticate Absinthe. Click “Continue to Absinthe” once authenticated.

10. Register the Event

  • Head over to Absinthe’s GraphQL playground at Absinthe GraphQL Playground.

  • Register the event name that you’ll use to issue points. Make sure this matches the event name you’ll use in Zapier under “Event Name”.

    Copy and paste the following query into the GraphQL playground at https://dka7gqe6jrgst.cloudfront.net/absinthe-gql.html Add your desired event name and description! Make sure to add your API key in the Authorization header in the Headers section as shown.

    Register Event Query:

    mutation RegisterOffChainEvent {
        insert_points_config_registered_off_chain_events_one(object: {
            event_name: "<your_event_name_to_register>", 
            description: "<your event description>"
        }) 
        {
            id
            created_at
        }
    }
    

Register Event Authorisation

   {
    "Authorization": "Bearer <YOUR_API_KEY_HERE>"
    }

11. Set Up the Action Input Data

  • In the Input Data section, select DISCORD_USERNAME for Account Type and User ID from the dropdown for Account ID.

  • Make sure the Event Name matches the one registered in Absinthe.

12. Test and Go Live

  • Click Test to verify that the setup is correct.

  • When everything is set up properly, click Publish in the top-right corner to activate your Zap.

For further customization, explore our Advanced Integration Guide to incorporate custom JavaScript or other unique functionalities.

By following these steps, you’ll have a robust system in place to reward users with points based on role assignments, seamlessly integrated with your Absinthe points system. Happy automating!

Absinthe Labs logo
Subscribe to Absinthe Labs and never miss a post.
#web3#discord#growth#blockchain#community