Discord Bot

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 Integrations > Servers.

  3. Click Create Server.

  4. Select Discord Server and click create.

  5. Follow the provided guide to get started.

  6. 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 player 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).

Discord Actions

Once you have setup 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 player.

  • 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 player. You can use this to ping the player by writing <@{discordId}> within the message.

    • {discordTag} - The Discord tag of the player (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 player in your Discord server.

Commands

!tebex:secret <secret>

This command is used to link your Discord Server with your Tebex Store. When you execute this command your secret key will be refreshed so it doesn't matter if you execute this command within a public channel. This command is only available to administrators.

!tebex:refresh

This command updates the channels and roles on your Tebex Store. If you've recently added a new channel or role to your Discord Server you will need to perform this command to make us aware of the changes. This command is only available to administrators.

!tebex:claim

This is the command that your players will need to execute within your Discord Server to receive their purchased packages after making payment. This command is displayed on the checkout complete page, however, we advise to also include a message in your package descriptions to ensure players know they have to enter this command after purchase.

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 players can login using the "Login With Discord" option to authenticate against their Discord account when adding packages to their basket.

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 %}