Discord bot configuration

Discord Bot Configuration

Three commands configure the bot: /login links it to your EnvyAuth account, /set_panel posts a customer-facing panel, and /set_modlogs routes the audit log to a webhook.

All three require the Administrator permission on the Discord server. If you haven't added the bot yet, see Discord bot first.

Log the server into your account

/login binds a Discord server to one EnvyAuth account. Every command run in this server then acts against that account.

  1. Run the /login command

    Type /login in any channel the bot can see, paste your EnvyAuth API key into the api_key field, and submit.

    Refer to Copy your login key for the tutorial on how to get your API key.

    The /login slash command in the Discord composer with the api_key field filled in
  2. Confirm the login response

    The bot replies privately with a "Logged in!" confirmation showing the linked account's username, plan, join date, and API key expiry. If you see "Login Failed", make sure you copied the key from Profile, not from API Tokens. The pages look similar but the keys are different.

    The Logged in confirmation showing the linked account's username, plan, join date, and API key expiry

Running /login again on the same server replaces the linked account.

Set up the customer panel

/set_panel posts a customer-facing panel in a channel. The panel has five buttons: redeem a key, get the loader, claim the buyer role, reset HWID, and check stats. One panel is bound to one project.

  1. Run /set_panel with all four options

    Submit /set_panel with all four options:

    • channel — the text or announcement channel where the panel will be posted.
    • manager_role — the role allowed to run /whitelist, /view_session, and /shutdown_session for this project.
    • buyer_role — the role the "Get Role" button assigns after a key is redeemed.
    • loader_file — your Lua loader source as an attachment, max 64 KB, UTF-8.
    The /set_panel slash command in the Discord composer with channel, manager_role, buyer_role, and loader_file filled in
  2. Customize the panel title and description

    The bot validates the loader file and opens a Customize Panel modal pre-filled with a default title (<Project Name> Control Panel) and description. Edit or leave the defaults, then submit.

    Customize Panel modal with pre-filled Panel title and Panel description fields
  3. Pick the project this panel manages

    Pick a project from the Setup Project dropdown. Each entry shows the project name and a short prefix of its ID.

    Setup Project dropdown listing the projects on the linked account
  4. Confirm the panel was posted

    The bot posts the panel and replies with a Panel Created! confirmation showing the panel ID, the bound project, and both roles.

    Panel Created confirmation followed by the posted panel with Redeem Key, Get Script, Get Role, Reset HWID, and Get Stats buttons

The panel's five buttons:

  • Redeem Key — opens a modal where the customer pastes a redemption key and is whitelisted on success.
  • Get Script — sends the customer the loader file you uploaded.
  • Get Role — assigns buyer_role to a whitelisted customer.
  • Reset HWID — clears the customer's HWID so the next execution rebinds to a new device. See HWID reset for cooldown rules.
  • Get Stats — shows the customer their whitelist status, key expiry, and HWID reset cooldown.

To replace an existing panel, run /set_panel again with the same channel. The previous entry is overwritten.

Configure moderation logs

/set_modlogs routes the bot's audit trail to a webhook. Whitelist, blacklist, HWID reset, panel, and login events all forward there.

Pass a channel or an existing webhook URL, at least one is required:

text
/set_modlogs channel:#mod-logs
text
/set_modlogs webhook:https://discord.com/api/webhooks/...

When you pass a channel, the bot creates a webhook named EnvyAuth Logs there and needs Manage Webhooks on that channel. When you pass a URL, the bot validates the prefix and stores it as-is.

The bot sends a test message after saving. If it lands, setup is complete.

Replacing the configuration

All three commands overwrite. Re-running /login swaps the linked account, /set_panel replaces the panel for that channel, and /set_modlogs replaces the stored webhook URL. There is no separate "unset" command. Configuration persists across bot restarts until you overwrite it.