Skip to content

Commit

Permalink
Remove webhook url from template env, add more info to readme section
Browse files Browse the repository at this point in the history
  • Loading branch information
yoggys committed Jul 21, 2024
1 parent c15829f commit f818d8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ By using OAuth2, it ensures users can't forge or fake appeals.
| Client ID | You can get this from the **General Information** section for the application you created in step 1. |
| Client secret | You can get this from the **General Information** section for the application you created in step 1. |
| Bot token | Get this in the **Bot** section that you used in step 2. |
| Webhook URL | You can create it in Discord Channel Settings -> Integrations -> Webhooks |
| Guild ID | This is where the developer mode you enabled in step 4 comes in handy. Right-click your server icon and press **Copy ID**. |
| Channel ID | Same deal than the guild ID, but with the channel you created in step 3. |
| JSON Web Token secret | Use a password manager to generate a password with ~50 characters, or mash your keyboard. |
Expand All @@ -45,10 +44,6 @@ By using OAuth2, it ensures users can't forge or fake appeals.

13. You should be good to go! You might want to test if it works as intended with an alt account, and if you encounter any problems feel free to [create an issue on GitHub](https://github.com/sylveon/discord-ban-appeals/issues/new).

## Using webhooks

When you use the `DISCORD_WEBHOOK_URL`, you don't need to specify the `DISCORD_BOT_TOKEN`, `GUILD_ID`, and `APPEALS_CHANNEL` in the environment variables. The message will be sent using the webhook without an unban button.

## Blocking users

Users that spam requests can be blocked by creating an environment variable called `BLOCKED_USERS`, which should contain a comma-separated list of quoted user IDs. To do this:
Expand All @@ -66,3 +61,17 @@ Users that spam requests can be blocked by creating an environment variable call
![](https://i.imgur.com/jNKgS2B.png)

6. Redeploy the site with **Deploys** -> **Trigger deploy** -> **Deploy site**.

## Using webhooks

When you use the `DISCORD_WEBHOOK_URL`, you don't need to specify the `DISCORD_BOT_TOKEN`, `GUILD_ID`, and `APPEALS_CHANNEL` in the environment variables. The message will be sent using the webhook without an unban button. To do this:

1. On your [Netlify dashboard](https://app.netlify.com), click **Deploys** and navigate to **Deploy settings**, and then to the **Environment** option.

2. Under **Environment variables**, click **Edit variables**.

3. Right-click on any channel and click **Edit Channel** -> **Integrations** -> **Webhooks** -> **Copy Webhook URL**.

4. Click **New variable**, and create an environment variable with `DISCORD_WEBHOOK_URL` as its key. For the value, paste the Webhook URL you copied in the previous step.

5. Redeploy the site with **Deploys** -> **Trigger deploy** -> **Deploy site**.
1 change: 0 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
DISCORD_CLIENT_ID = "Your Discord App's client ID"
DISCORD_CLIENT_SECRET = "Your Discord App's client secret"
DISCORD_BOT_TOKEN = "Your Discord Bot Token"
DISCORD_WEBHOOK_URL = "Your Discord Webhook URL"
GUILD_ID = "ID of the guild this deployment targets"
APPEALS_CHANNEL = "ID of the channel used for appeal form submission"
JWT_SECRET = "JSON Web Token secret, mash keyboard plz"

0 comments on commit f818d8e

Please sign in to comment.