Discord Servers

Our Discord Bot allows you to sell access to roles within your Discord Server - a great way of generating additional revenue for your community.

To integrate your Discord Server with your Tebex Store please do the following:

  1. Login to the control panel.

  2. Go to Discord Servers.

  3. Click Connect Discord Server.

  4. Follow the provided guide to get started.

  5. Once you have created a server and it is successfully connected you are able to define Discord Actions when creating packages. Discord Actions can consist of assigning a role to a customer upon purchase, removing a role, or sending a customisable message to a channel of your choice.

Our official Discord Bot's username is Tebex#8323 (695664615534755850).

YouTube Tutorial Video

Watch the video tutorial below to see how you can install the Discord bot:

Discord Actions

Once you have set up your Discord Server in the control panel, you can add Discord Actions against packages (that have the Discord Server selected). The three types of Discord Actions are outlined below.

  • Assign Role - You can select a role in your Discord server that will be assigned to the customer.

  • Send Message - Enter a message and choose which channel in your Discord server you'd like to send it to. Within the message, you can include any of the standard command variables and the following Discord-specific variables.

    • {discordId} - The Discord ID (in snowflake format) of the customer. You can use this to ping the customer by writing <@{discordId}> within the message.

    • {discordTag} - The Discord tag of the customer (e.g. Test#0001).

    If you wish to include a link to a specific channel within the message you can use <#696748377349681212> where 696748377349681212 represents the Discord channel ID.

  • Remove Role - Remove a role from the customer in your Discord server.

Commands

As Discord now utilises slash commands, simply type / and you will be presented with the various Tebex commands that you can use which include: buy, claim, refresh, id, link which will perform the relevant action.

Template Changes

You'll need to make some simple changes to your template if you aren't using the standard Flat/Abstract templates we provide. This is to ensure that customers can log in using the "Login With Discord" option to authenticate against their Discord account when adding packages to their basket. These changes are not required and are done on your behalf automatically if you are using one of the premium templates.

Abstract

If you have built your custom template from the Abstract template, please make the following changes.

  1. Navigate to options.html within the Template Editor.

  2. Within the {% for variable in options.variables %} loop in options.html, please find the line that reads {% else %} roughly 20 lines below.

  3. Replace the above {% else %} statement with the following.

    {% elseif variable.id == "discord_id" %}
        <p>{{ variable.description }}</p>
        
        <div class="input-group">
            <input type="text" class="form-control input-lg" readonly value="{{ variable.value ? "Logged in as " ~ variable.discord_tag : "Not logged in" }}">
            <span class="input-group-append">
              <a href="https://ident.tebex.io/discord/?return={{ url() }}" id="login-with-discord" class="btn btn-info">Login with Discord</a>
          </span>
        </div>
        
        <input type="hidden" name="variables[{{ variable.id }}]" value="{{ variable.value }}" />
        <br />
    {% else %}

Flat

If your custom template is built upon the Flat template, you will need to make the following amends.

  1. Navigate to options.html within the Template Editor.

  2. Find the following block of code within options.html:

    {% elseif variable.id == "discord_tag" %}
        <div class="input-group">
            <span class="input-group-btn">
                <a href="https://ident.tebex.io/discord/?return={{ path() }}" class="btn btn-info btn-lg">Login with Discord</a>
            </span>
            <input type="text" name="variables[{{ variable.id }}]" class="form-control input-lg" placeholder="{{ variable.description }}" value="{{ variable.value }}" />
        </div>
    {% else %}
  3. Replace the above block of code with the following:

    {% elseif variable.id == "discord_id" %}
        <p>{{ variable.description }}</p>
    
        <div class="input-group">
            <input type="text" class="form-control input-lg" readonly value="{{ variable.value ? "Logged in as " ~ variable.discord_tag : "Not logged in" }}">
            <span class="input-group-btn">
                <a href="https://ident.tebex.io/discord/?return={{ url() }}" id="login-with-discord" class="btn btn-info btn-lg">Login with Discord</a>
            </span>
        </div>
        
        <input type="hidden" name="variables[{{ variable.id }}]" value="{{ variable.value }}" />
        <br />
    {% else %}

Last updated