Skip to content

Commit

Permalink
Document setting the causes emoji env
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Nov 1, 2024
1 parent 8ef52c8 commit eddde20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dev.vars.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DISCORD_CLIENT_SECRET=<discord_client_secret>
# DISCORD_GUILD_ID=<discord_guild_id>
# DISCORD_SUMMARY_WEBHOOK=<discord_webhook_url>
# DISCORD_MILESTONE_WEBHOOK=<discord_webhook_url>
# DISCORD_CAUSES_EMOJI=<discord_causes_emoji_object>
# WORKER_BASE_URL=<worker_base_url>

STATS_API_ENDPOINT=https://dashboard.jinglejam.co.uk/api/tiltify
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

1. Create your test Discord application at https://discord.com/developers/applications (this does not need a bot account, just the application).
2. Create your `.dev.vars` file.
- Copy `.dev.vars.example` and fill out the information from your Discord application, plus the ID of your test server/guild and webhooks for the bot to use.
- Copy `.dev.vars.example` and fill out the information from your Discord application, plus the ID of your test server/guild where you'll use the bot.
- Optionally, `DISCORD_SUMMARY_WEBHOOK` + `DISCORD_MILESTONE_WEBHOOK` can be set to channel webhooks for testing the scheduled messages.
- Optionally, `DISCORD_CAUSES_EMOJI` can be set to a JSON object mapping the cause names to custom emoji Markdown (which can be [uploaded directly to the Discord application](https://discord.com/developers/docs/resources/emoji#emoji-object-applicationowned-emoji)).
3. Authenticate with Wrangler by running `npx wrangler login`.
4. Update `wrangler.toml` for your account.
- Use `npx wrangler whoami` to get your account ID, update the value in `wrangler.toml` to match.
Expand All @@ -24,7 +26,7 @@ Ensure that the environment in `wrangler.toml` has been updated with your chosen

Ensure that the KV namespaces are created for staging/production environments and are configured in `wrangler.toml`. Use `npx wrangler kv:namespace create "STORE" -e <staging/production>`.

You'll also want to set `DISCORD_CLIENT_ID` + `DISCORD_PUBLIC_KEY` + `STATS_API_ENDPOINT` (optionally, `DISCORD_SUMMARY_WEBHOOK` + `DISCORD_MILESTONE_WEBHOOK` + `WORKER_BASE_URL`) as secrets for the worker, which you can do with `npx wrangler secret put <var name> -e <staging/production>` (the webhook secrets can contain multiple webhooks, separated by a comma).
You'll also want to set `DISCORD_CLIENT_ID` + `DISCORD_PUBLIC_KEY` + `STATS_API_ENDPOINT` (optionally, `DISCORD_SUMMARY_WEBHOOK` + `DISCORD_MILESTONE_WEBHOOK` + `DISCORD_CAUSES_EMOJI` + `WORKER_BASE_URL`) as secrets for the worker, which you can do with `npx wrangler secret put <var name> -e <staging/production>` (the webhook secrets can contain multiple webhooks, separated by a comma).

If you're deploying for local, make sure that you've got the appropriate environment variables set for `DISCORD_CLIENT_ID`, `DISCORD_CLIENT_SECRET` + `DISCORD_GUILD_ID` (otherwise, they'll default to the values in `.dev.vars`).

Expand Down

0 comments on commit eddde20

Please sign in to comment.