Discord Purchase Roles FAQ¶
Questions¶
Does the customer have to be in my Discord server already?¶
Yes, unless you switch on Automatically join eligible customers to their servers. Without it, a customer who is not a member gets "Please join the Discord server before syncing roles." Once they have joined, the roles arrive with the next sync: within 15 minutes through the scheduled run, or at once when they click Sync my Discord roles.
Which permissions does the customer grant?¶
identify only, which lets the extension read the Discord user ID and name. With the server join option on, identify and guilds.join. The extension does not request e-mail, messages or the customer's server list.
Can one product give several roles, or roles in several servers?¶
Yes. Create one mapping per role. Fill Server (guild) ID override for a role in another server. The same bot must be a member of every server.
What happens to the role when a service is suspended?¶
By default it stays. Set While a service is suspended to Remove the Discord role to treat a suspended service like an ended one. The role is then removed if its mapping has Remove the role when the service ends on.
A customer owns two products that give the same role and cancels one. Do they lose the role?¶
No. The role stays as long as one enabled mapping for it still matches a qualifying service.
Will the extension remove roles my moderators gave by hand?¶
No. It removes only roles recorded in Discord Role Grants, which are roles it added itself or roles you adopted with Adopt existing mapped roles. One limit: Discord stores a role only once per member. If the extension gave a role and a moderator gives the same role again by hand, the extension cannot tell the difference and still removes it when the service ends. Do not use the same role for product access and for manual access.
I updated from 1.0.x. Why are old roles not removed when a service is cancelled?¶
Version 1.0.x kept no record of the roles it gave, so after the update they count as roles given by hand. Use Adopt existing mapped roles on the customer's row in Discord Accounts if the extension should manage them. See Usage.
Does unlinking or cancelling kick the customer from the server?¶
No. The extension only adds and removes roles and, with the server join option, adds members. It never removes a member.
Can two customers link the same Discord account?¶
No. The second attempt is refused with "That Discord account is already linked to another customer."
Where are the tokens stored?¶
In the extension's own tables. The bot token, the OAuth2 client secret and each customer's OAuth2 access and refresh token are encrypted with Laravel's encryption, which uses Paymenter's APP_KEY. The settings form never loads a stored secret into the browser.
Warning
If APP_KEY changes, the stored secrets can no longer be decrypted. Keep the key when you move the installation.
Does disabling or uninstalling remove the roles in Discord?¶
No. Disabling stops all syncing and keeps the data. Uninstalling drops the tables. Neither changes Discord. Unlink the accounts first if the roles should go.
Troubleshooting¶
Roles do not arrive or are not removed¶
Check in this order:
- Discord Accounts: is the customer linked, and what does Last error say?
- The service: does it belong to that customer, is its product mapped, and is its status
active(orsuspendedwith the keep setting)? - The mapping: is it Enabled, is the role ID right, and is the server override empty or correct?
- Discord: is the bot a member of the server, does it have Manage Roles, and is its role above the mapped role?
- Paymenter: are the queue worker and the scheduler running? Automatic syncs are queued jobs. Without a worker, only the manual sync buttons do anything.
- Discord Role Grants: a role is only removed if it is listed there.
Errors are also written to Paymenter's log as warnings with the text Discord API call failed., the action and the HTTP status.
Messages on the customer page and in Discord Accounts¶
| Message | Cause and fix |
|---|---|
| Discord is not configured yet. Please contact support. | Bot token, default server ID, client ID or client secret is missing in Discord Settings. |
| The Discord request could not be verified. Please try again. | The state value Discord returned does not match the one in the customer's session, for example because the session expired or the link was opened in another browser. The customer starts linking again. |
| Discord rejected the authorization code. Please try again. | The code exchange failed. Check OAuth2 client ID and OAuth2 client secret, and that the redirect URI in the Discord application is exactly the one shown in Discord Settings. |
| Your Discord identity could not be read. | Discord did not return the user for the new token. The customer tries again. |
| That Discord account is already linked to another customer. | The Discord account belongs to another Paymenter customer. |
| That Discord account is already linked or still awaiting role cleanup. | Same as above, or the Discord account still has ledger entries of another or a deleted customer. Finish the cleanup in Discord Role Grants first. |
| Please join the Discord server before syncing roles. | The customer is not a member of the server and the server join option is off. |
| Server join failed. Please reconnect Discord with server-join consent, or contact support. | The customer linked without the guilds.join consent, the stored token expired and could not be renewed, or Discord refused the join. The customer uses Reconnect / change Discord account. Also check that the bot belongs to the OAuth2 application and has Create Instant Invite. |
| Please complete the Discord server membership screening before receiving roles. | The member has not accepted the server's rules screen yet. |
| Your Discord roles could not be read. Please try again or contact support. | Discord did not return the member: timeout, wrong server ID, the bot is not in that server, or the bot token is invalid. |
| Some role changes were rejected by Discord. | Adding a role failed. Usual causes: the bot lacks Manage Roles, its role is not above the mapped role, or the role ID does not exist in that server. |
| Some Discord roles could not be removed. Please try again or contact support. | Removing a role failed, for the same reasons. |
| Discord is not configured; role cleanup remains pending. | A cleanup ran without a stored bot token. |
| More Discord changes remain; another sync will continue. | The sync used up its time. The next sync carries on. |
| The Discord operation could not be completed. Please try again or contact support. | An unexpected error, or another sync for the same customer or Discord account held the lock for more than three seconds. Try again. If it happens every time, check that your cache store supports locks. |
| Unlink pending. Role cleanup will retry automatically; no new roles will be granted. | An unlink could not remove every role. See Unlinking. Fix the cause shown in Last error; the 15 minute run finishes the unlink. |
Problems with permissions, role order or wrong IDs are not fixed by retries. Correct them in Discord or in the mapping, then run Sync Discord Roles.
The test connection passes but roles still fail¶
Test connection checks the bot token and that the bot can read the default server. It does not test Manage Roles, the role order or servers set as an override. Run Sync Discord Roles on a linked test account and read the result.
Entries stay in Discord Role Grants with cleanup pending¶
The role could not be removed or the member could not be read. An entry is cleared without a removal only when Discord confirms that the user is no longer a member of the server. A server the bot cannot read does not count as proof, so the entry stays. Put the bot back into the server, or fix its permissions, and click Retry.