> For the complete documentation index, see [llms.txt](https://docs.andrezzz.pt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.andrezzz.pt/whmcs/addons/link-discord.md).

# Link Discord

Would you ever imagine, if you could have your WHMCS Clients verified with a Discord account and give them, in real-time, roles inside your guild? Now you can! By an affordable price.

<figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FE7j3za18VNMCxDZNMW9y%2FAndrezzzLinkDiscord_-_Logo__1_-removebg-preview%20(1).png?alt=media&amp;token=08092633-8e27-4b28-931a-ccb4613be35a" alt="" width="250"><figcaption><p>Fig. 1 - Link Discord</p></figcaption></figure>

{% hint style="info" %}
Discord and related names, marks, emblems and images are registered trademarks of their respective owners.
{% endhint %}

## Screenshots

<div><figure><img src="https://cdn.andrezzz.pt/whmcs/addons/link-discord/Homepage%20Panel.png" alt=""><figcaption><p>Fig. 2 - Homepage Panel</p></figcaption></figure> <figure><img src="https://cdn.andrezzz.pt/whmcs/addons/link-discord/Homepage%20Panel%20-%20Linked.png" alt=""><figcaption><p>Fig. 3 - Homepage Panel (Linked)</p></figcaption></figure></div>

<figure><img src="https://cdn.andrezzz.pt/whmcs/addons/link-discord/Linkage%20Info%20page.png" alt=""><figcaption><p>Fig. 4 - Linkage Page</p></figcaption></figure>

<figure><img src="https://cdn.andrezzz.pt/whmcs/addons/link-discord/Admin%20-%20Edit%20and%20Delete.gif" alt=""><figcaption><p>Fig. 5 - Admin side (Edit and Delete)</p></figcaption></figure>

## Installation

1. Download the release from the latest email you've received;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FEnGoRpV92KXRiSbLkHsG%2Fchrome_fOGUtzkZZb.png?alt=media&amp;token=d43bcbd1-38b0-4798-b20c-203b28111b12" alt=""><figcaption></figcaption></figure>

### Discord

1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) and create a new Application (if you have already, skip this step);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FRVQxCTTzPFGRb7lxMe6P%2FoXxJ2IUIBg.gif?alt=media&amp;token=4edfdc36-35af-4da7-b235-5cb1186afb1f" alt=""><figcaption></figcaption></figure>
2. Click in the `OAuth2` tab, copy and save the `Client ID` and the `Client Secret` (if you don't have the button, reset it);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FH5sKweUyJIymBENknB2R%2Fimage.png?alt=media&amp;token=251ff562-e8e3-41a6-86d7-a9e7320bab40" alt=""><figcaption></figcaption></figure>
3. Add a new Redirect using the URL that you saved in [WHMCS - Step 3](#whmcs) (skip this step if you haven't set up the WHMCS side yet);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FUyDa7YDaRb8SmWNOsrxz%2Fimage.png?alt=media&amp;token=66d2b69d-a9e6-4bbc-955b-1f321c0fdd52" alt=""><figcaption></figcaption></figure>
4. Click in the `Bot` tab, create the Bot if you don't have and save the `Token` (if you don't have the copy button, reset it). For security reasons, ensure that `Public Bot` it is off;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FgUnhJoqQahTBuf4wojqJ%2Fimage.png?alt=media&amp;token=616a87cb-3ea8-4049-83ae-4dc49c82816d" alt=""><figcaption></figcaption></figure>
5. Add the Bot, by simply going to this [URL](https://discord.com/oauth2/authorize?scope=bot\&permissions=8\&client_id=CLIENTID) and editing in the Search Bar the `CLIENTID` to yours. Select the desired Guild, click on Continue and Authorize (you need to do this for every Guild you wanna add). Don't change the permission code so that it can work with other features.

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FX7xxGaANhfUHr5HjlEsf%2Fimage.png?alt=media&amp;token=1ba65a0b-7286-406f-9421-34b29c761e87" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FoIimP8u48V23x4eKoAmf%2Fimage.png?alt=media&amp;token=9908ac16-a6d6-471d-b3dc-8373df0204ea" alt=""><figcaption></figcaption></figure>

### Backend

{% tabs %}
{% tab title="cPanel" %}
{% hint style="success" %}
This is the best solution if you use cPanel on shared web hosting.
{% endhint %}

1. Open your cPanel, search for `Setup Node.js App` and open it;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FQEI62kpnOgHDJyAUiGcX%2Fimage.png?alt=media&amp;token=555c7e60-b590-446e-b2ed-69d7b0c51fb8" alt=""><figcaption></figcaption></figure>
2. Click on New Application, Setup like below (you can choose any domain) and Create;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FgLSdwB4QS63yMvHlt3jp%2Fimage.png?alt=media&amp;token=65fcd8f6-f234-4d09-a76d-8582b6d844f1" alt=""><figcaption></figcaption></figure>
3. Upload the `BACKEND` folder to `/AndrezzzLinkDiscord` (normally, when you open FTP/File Manager, it opens the `public_html` folder, you need to go back);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2F5KWMQdspIRFAQAWEfrHP%2Fezgif-3-886890f870.gif?alt=media&amp;token=32b41ed0-b162-4ed6-8928-ea32d78d4632" alt=""><figcaption></figcaption></figure>
4. Edit the `config.json` file, with the information you gathered before in the [Discord Installation](/whmcs/addons/link-discord.md#discord) and change the `port` to `3000`;&#x20;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FLIDifzaGPkf0IfNWyXdK%2Fimage.png?alt=media&amp;token=b90544e0-8ee8-4ca5-ba55-d7c7c886d631" alt=""><figcaption></figcaption></figure>
5. Go back to the Application that you just created, refresh the page and click on `Run NPM Install`;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2F8XCmr4IPfHgWLyaKRuBn%2Fimage.png?alt=media&amp;token=c3115486-d07b-45a4-8b73-8c8457384f1b" alt=""><figcaption></figcaption></figure>
6. Click on `Restart` and then test it by clicking the `Open` button, if it doesn't redirect to my Website, then some mistake was made. Please check every single step. If it's all working, you can copy the URL in the Search Bar and save it to [WHMCS - Step 3](#whmcs).&#x20;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FNE8IqzVsAzq1EDmh8Lhk%2Fimage.png?alt=media&amp;token=e32dc93f-20a1-45fa-8094-0803a45718e1" alt=""><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Pterodactyl" %}
{% hint style="warning" %}
If you can't allow IPs to make connections to the outside (Allow specific IPs for Outgoing Traffic in some ports), please try one of the following ports, and for more information, please check the [FAQ](#couldnt-connect-to-server):

* 2082-2083;
* 2086-2087;
* 4081-4085;
* 8080-8088;
* 8888\.
  {% endhint %}

1. Create a new Server using the above ports, or if you manage the Hosting where the WHMCS is, you can choose any port.\
   Choose the Egg `discord.js generic` and at least the image that contains `nodejs_16`in the name (if you don't have it, download it from their GitHub).\
   Change the Bot.js file to `app.js`;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FstkM5l0JKxQNI1AJ9WSU%2Fimage.png?alt=media&amp;token=df7a0f16-5b64-4c03-ad82-9981b5f74674" alt=""><figcaption></figcaption></figure>
2. Wait until the server is created and upload the files using FTP or the File Manager (if you use the File Manager, please ZIP the `BACKEND` folder contents first, then `Unarchive`);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2Fo06CiYfUgEBZlw9IP4fp%2Fimage.png?alt=media&amp;token=d38e57cc-f04a-4379-a35e-a11d0fb6fc19" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FOL0l3dJJG8nq92lQa2zu%2Fimage.png?alt=media&amp;token=25099538-1268-4d8a-b7e9-48ac430696f9" alt=""><figcaption></figcaption></figure>
3. Edit the `config.json` file, with the information you gathered before in the [Discord Installation](/whmcs/addons/link-discord.md#discord) and change the `port` to the one you chose before;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2Fj1muxUKx7S1K9edCWKAh%2Fimage.png?alt=media&amp;token=80d1e7ae-e828-425f-a059-9122ce992439" alt=""><figcaption></figcaption></figure>
4. Start/Restart the Server and wait until you see the logs below. Test it by clicking on the IP:Port on `Address` and pasting it at the Search Bar. If it doesn't redirect to my Website, then some mistake was made. Please check every single step. If it's all working, you can copy the URL in the Search Bar and save it to [WHMCS - Step 3](#whmcs).&#x20;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2Fgxrs7TDj77W1okbJci5w%2Fimage.png?alt=media&amp;token=56a520fc-dcc9-46d1-8c35-54de1ac39ed7" alt=""><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Self Hosted (SSH)" %}
{% hint style="danger" %}
If you don't have Node.js installed yet, or if you already have, make sure you have at least v16.11.0. You can check this by running in your Terminal:

{% code fullWidth="false" %}

```shell
node --version
```

{% endcode %}
{% endhint %}

{% hint style="warning" %}
If you can't allow IPs to make connections to the outside (Allow specific IPs for Outgoing Traffic in some ports), please try one of the following ports, and for more information, please check the [FAQ](#couldnt-connect-to-server):

* 2082-2083;
* 2086-2087;
* 4081-4085;
* 8080-8088;
* 8888\.
  {% endhint %}

1. Open your SSH Terminal and create a folder for the Bot. For example, you can use `/opt/AndrezzzLinkDiscord`;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FyR0LDUPOmb02l4CKSj2o%2F2023-09-16_22-49.png?alt=media&amp;token=ed6e5a68-94ed-4398-80f4-1ac2d7cdb7cc" alt=""><figcaption></figcaption></figure>
2. Upload the `BACKEND` folder to the one you've just created, `/opt/AndrezzzLinkDiscord` (normally, when you open FTP, it opens the user folder, you need to go to the desired folder);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2F5KWMQdspIRFAQAWEfrHP%2Fezgif-3-886890f870.gif?alt=media&amp;token=32b41ed0-b162-4ed6-8928-ea32d78d4632" alt=""><figcaption></figcaption></figure>
3. Edit the `config.json` file, with the information you gathered before in the [Discord Installation](/whmcs/addons/link-discord.md#discord) and change the `port` to the one you wanna use (don't forget to open it in your Firewall, if any, to allow Inbound Connections);&#x20;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FLIDifzaGPkf0IfNWyXdK%2Fimage.png?alt=media&amp;token=b90544e0-8ee8-4ca5-ba55-d7c7c886d631" alt=""><figcaption></figcaption></figure>
4. Install the necessary packages for the Backend to run by doing `npm i` in your Terminal, in the same folder, you have your `config.json`;
5. Edit the `AndrezzzLinkDiscord.service` file, and don't forget to replace it with the folder that you created in Step 1 (if you have a custom path for the Node.js executable, change it also);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FKO697V3nUXJEHPvgeJyH%2F2023-09-16_22-57.png?alt=media&amp;token=f46ab9d1-07e7-49c5-9485-5406ee8a04d2" alt=""><figcaption></figcaption></figure>
6. Move the last file you edited to the folder `/etc/systemd/system`, enable it and start the Service;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2Fpj14O9K37Qxu4nKyNjZn%2F2023-09-16_23-09.png?alt=media&amp;token=764fe72c-4715-41a6-8ec0-456c8d595024" alt=""><figcaption></figcaption></figure>
7. Test it by pasting the server's IP with the port you chose at the search bar. If it doesn't redirect to my website, then some mistake was made. Please check every single step. If it's all working, you can copy the URL in the Search Bar and save it to [WHMCS - Step 3](#whmcs).&#x20;
   {% endtab %}
   {% endtabs %}

### WHMCS

1. Upload the `modules` folder to your WHMCS root folder;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FsIbIqsAmAM1gsD3fyVrX%2F3jRBJKnj1f.gif?alt=media&amp;token=db9be2ce-01d4-4097-b501-097dcff26cf0" alt=""><figcaption></figcaption></figure>
2. Go to `Setup -> System Settings -> Addon Modules` and active the module `Andrezzz - Link Discord`;

   <div><figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2F8l9vMNmXIJekk1yzpt7k%2Fimage.png?alt=media&amp;token=c49e92dc-eba6-4036-b0bc-27b56958b29d" alt=""><figcaption></figcaption></figure> <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FNO3GpdWCwAFwsy99gnyW%2Fchrome_6sfsmCfmeV.png?alt=media&amp;token=5642173e-0919-4df8-a1f4-2b765043140d" alt=""><figcaption></figcaption></figure></div>
3. Go to the configuration of the Addon and fill out all the information required (copy the URL given in `Discord OAuth2 Redirect` and go to the [Discord - Step 3](#discord)). Please check the [FAQ](#frequent-asked-questions-faq), if you have any questions;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2Foc34rsTOdXC4X7uPwRgb%2F2023-09-17_10-49.png?alt=media&amp;token=fcf5fb57-52f9-4bb5-b189-c2c9b8934980" alt=""><figcaption></figcaption></figure>
4. Go to `Addons -> Andrezzz - Link Discord` and add to the table the desired roles for each type you want. Please check the [FAQ](#frequent-asked-questions-faq), if you have any questions.

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FcwRtMAksrYU14M5wATLG%2Fimage.png?alt=media&amp;token=781bfe1f-b0b5-4e90-a233-82c5778f406a" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
You're pretty to go. Have a good use of the module, and thank you once again 😊!
{% endhint %}

## Troubleshooting

For Commum Issues, kindly check the [Frequent-Asked Questions (FAQ)](#frequent-asked-questions-faq). if you don't find it, check the options below to troubleshoot it.

### WHMCS

{% hint style="info" %}
This is the easiest way to debug the module inside the WHMCS.
{% endhint %}

1. Go to `System Logs -> Module Log` and activate it if you don't have it already and try to repeat the issue;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FG0TfgSph7jsumquOeIvI%2Fimage.png?alt=media&amp;token=db7e48f8-3847-40e2-8444-22ca6429416d" alt=""><figcaption></figcaption></figure>
2. If you find any error similar to the one below, it's most likely a firewall issue. Please check the [FAQ](#couldnt-connect-to-server);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2Fn6ZBJY7hf1jQE2hAECq8%2Fimage.png?alt=media&amp;token=5403e33c-12b5-4e88-b2f5-c800483a99cc" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FklJj4aaDeEZFvsh7lOoG%2Fimage.png?alt=media&amp;token=9f87b476-99d5-494e-9675-8c994aa2305d" alt=""><figcaption></figcaption></figure>
3. If you find any error similar to any below, it's most likely a backend issue. Please check the [FAQ](#frequent-asked-questions-faq). For the [first case](#couldnt-connect-to-server) and for the [second case](#whmcs-keeps-loading);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2F7jHPWY4JysUSvpAgrPOr%2Fimage.png?alt=media&amp;token=4517e6ae-f482-41c5-9da2-a34202f0434e" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2F0e6Am4ybQgknPNy7hW34%2Fimage.png?alt=media&amp;token=c4def0d4-d2bb-4fea-94f1-d421526ef5ab" alt=""><figcaption></figcaption></figure>
4. If you find any error similar to the one below, it's a Backend error. First, check if the [FAQ](#frequent-asked-questions-faq), have anything about it. If not, go to [Backend Troubleshooting](#backend-1);

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FY7kr8W6dDBabjk5lQbCs%2Fimage.png?alt=media&amp;token=75319af1-6975-4e1b-9f25-a1d1e9f2cbe8" alt=""><figcaption></figcaption></figure>

### Backend

1. Edit the file `config.json,` change the Setting `debug` to `true` and restart the Bot;

   <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FNKuLVVLqc3LfcARxxnsC%2Fimage.png?alt=media&amp;token=56ec7b4c-c60c-4508-afbe-a196dbed68cc" alt=""><figcaption></figcaption></figure>
2. Repeat the request/action and check the console. If you don't find anything similar in the [FAQ](#frequent-asked-questions-faq), please report it to me at [Report](#report).

### Report

As a final step, if you don't find the solution, please report it to me with the maximum information as possible. Please copy the following template, edit and send it to me using one of my [Contact](/contact.md).

```markup
System Information:
 - PHP Version: 8.1
 - WHMCS Version: 8.6.2
 - Node.js Version: 16.16.0

Issue: The WHMCS doesn't assign the roles if they have too many services.
Any relative information: The client has 1000 services.

Steps to reproduce:
 1. Link the Discord;
 2. Buy one more service.
 
Request: Array
(
    [action] => add
    [clientID] => 2
    [discordID] => 1014159062302195792
    [roles] => Array
        (
            [826466298555793408] => Array
                (
                    [0] => 826466298555793412
                    [1] => 826466298555793415
                )

        )

)

Response: Array
(
    [result] => error
    [message] => Error while adding the user: Invalid role(s) provided (826466298555793415)
)

```

## Frequent-Asked Questions (FAQ)

### Notifications

Currently, there are two types of Notifications:

* Type Related: when a Hook is triggered, a personalised and translatable notification will be sent, based on the e-mail client's preference. At the moment, currently supports InvoicePaid, InvoiceCreated, TicketOpen, TicketOpenAdmin, TicketAdminReply, TicketClose, CancellationRequest, AfterModuleSuspend and AfterModuleUnsuspend.
* E-mail Redirect: simply redirects every single e-mail to their Discord DM. This could break some ToS from Discord since you're sending to their DM personal information.

{% hint style="danger" %}
I'm not responsible for any kind of Ban/Warning that you can in Discord, by using any sort of Notifications. Using the Type Related, you have almost no chance to get it, but if you choose E-mail Redirect, since it has Personal Information about the Client itself (e.g. Name, Address or ID), it can be seen as a Data Leakage.

Due to the EU Law GDPR, they're very cautious.
{% endhint %}

For any questions, you may have, you can contact me anytime, [here](/contact.md).

### Where to Show

Currently, there are two types of places to show the current Link:

* Homepage Panel

  <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FBoJDWyrUPriMEf010Twc%2F2023-09-17_11-03_1.png?alt=media&amp;token=9f867794-a58e-4f8b-bdb6-396f17fcb341" alt=""><figcaption></figcaption></figure>
* Secondary Sidebar

  <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FJgaCAwE05xunLKdjdHys%2F2023-09-17_11-03.png?alt=media&amp;token=a9b9881b-0c64-4c15-9f87-e00bab0564a9" alt=""><figcaption></figcaption></figure>

Adicional to this, and after version 1.7, it's automatically added to the WHMCS Sign-in Integrations, so if the Client clicks in his name and chooses `Security Settings`, he'll see something like this page. My system works the same as before.

<div><figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FEupTVqm3UDJkllb8IcyR%2F2023-09-17_11-08.png?alt=media&amp;token=125fa983-a066-41cc-bf6b-9344602107a7" alt=""><figcaption></figcaption></figure> <figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FxaGS39MPrHsLvkMFFCYg%2F2023-09-17_09-17_1.png?alt=media&amp;token=8038e344-f0aa-4a24-9a78-bc7fd7f9a49e" alt=""><figcaption></figcaption></figure></div>

### Redirect to the Linkage

This option, commonly mistaken, asks if you wanna redirect the Client to your Client Area or to show the Linked Discord information. Also, this is essential if you want the Client to choose if he wants to receive Notifications in their DM or not if you have this enabled.

<figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FCZI3IginXW6ZsrEp5qdT%2FLinkage%20Info%20page.png?alt=media&amp;token=cb193ca1-9a26-45b6-987c-36e2c779d00c" alt=""><figcaption></figcaption></figure>

### Linkage Page not showing properly

If you see your Linkage Page showing like the one below, it's probably because you Upgraded from an older Version or you have some temporary bug in your Templates Cache. To go around this problem, you should go to `Utilities -> System -> System Cleanup` and click on `Empty Template Cache`.

<figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2Fq9dUP5uZRMhsZToP4hao%2Fimage.png?alt=media&amp;token=633f829b-ac64-4b40-ab84-727c8f9e1567" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3928726770-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxfYHqiCz3LmpD7lBUylH%2Fuploads%2FKDKpIGeAAoVlqO2xa3KK%2Fimage.png?alt=media&amp;token=258c3f65-b010-429b-be84-da4fc192bfc6" alt=""><figcaption></figcaption></figure>

### Type of Roles

Currently, the module supports the following attribution criteria:

* **Guest:** Client has no active services.
* **Client:** Client has at least one active service.
* **Group:** Client belongs to the specified client group.
* **Product:** Client has at least one active service of the specified product.
* **Product Addon:** Client has at least one active service of the specified product addon.
* **Product Group:** Client has at least one active service within the specified product group.
* **Product Server:** Client has at least one active service hosted on the specified product server.

### Dropdown without any Guild

If you don't have any Guilds in the dropdown, please check if you added the Bot to the desired Guild. Check the [Discord - Step 5](#discord).

### Invalid role(s) provided

If you get this error in the Backend API or in the [Module Log](#whmcs-1), check if the Bot/the Bot role is upper than the role you wanna give.

### Couldn't connect to server

If you find this in your [Module Log](#whmcs-1), you either have a Connection Refused (Backend Firewall) issue or a Firewall (WHMCS) issue. Check below:

* If you see `after 0 ms`, can be a Connection Refused issue. Check if you have a Firewall in the Backend, and if yes, if you allowed the Port you're using;
* If you see `after x ms`, where `x` is a value greater than 0, and can be a firewall in the server on which you're running the WHMCS. To solve this issue, you should contact your Hosting Provider and ask them to allow the Backend IP, to have an Outgoing connection. If they don't allow it, please use port 80 or 443;
* If you see `after x ms: Connection refused`, where `x`, can be 0 or greater than 0, can be the issue before.

### WHMCS keeps loading

If you find your WHMCS, loading more time than it usually takes or keeps loading, it's due to the connection between WHMCS and the Backend. The Backend is giving a Timedout issue. To work around this, please check:

* If you're using the right URL or IP:Port combination;
* If the `config.json` doesn't have the wrong IP Address or Port.

## Thanks

This module and all its features wouldn't have been possible if I didn't have the help of wonderful people who stayed by my side throughout  allthe progress and helped me in every step I made. Gave ideas, argued mine, and tested them at all costs.

Thank you again to all the buyers for your help and kindness ❤️!

```
pacman™#4344 - Idea of the project
Dylan#1234 - Bug help
xDizziex#0001 - Suggestions & Dutch Translation
༺j༻#3333 - Readme Docs
Metuant#5074 - Suggestions & Bug help
Pinkmare#1337 - Suggestions
jake-#9777 - Bug help
Maxou45400#6336 - Bug help
Silver.#2200 - Suggestions
MonkeyWhisper#0001 - Suggestions
Richard (TheShiper)#3163 - Docs Help & Suggestions
Don | Check my Bio!#1001 - Donation
RX#4609 - Bug help
Ciel#3836 - Discord ToS Help
Fulger#0492 - Bug help & Romanian Translation
Mika L.#0666 - German Translation
Matthew#2000 - Suggestions
```
