Skip to content

Commit

Permalink
Document new environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Nov 6, 2024
1 parent da8f11b commit 62888f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .dev.vars.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ DISCORD_CLIENT_SECRET=<discord_client_secret>
# DISCORD_GUILD_ID=<discord_guild_id>
# DISCORD_SUMMARY_CHANNEL=<discord_channel_id>
# DISCORD_MILESTONE_CHANNEL=<discord_channel_id>
# DISCORD_CAUSES_EMOJI=<discord_causes_emoji_object>
# DISCORD_CAUSES_EMOJI={"Wallace & Gromit's Grand Appeal":"", ...}
# DISCORD_REGULAR_EMOJI={"mascot":"","happy":"","hype":"","love":"","sad":""}
# WORKER_BASE_URL=<worker_base_url>

STATS_API_ENDPOINT=https://dashboard.jinglejam.co.uk/api/tiltify
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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 where you'll use the bot.
- Optionally, `DISCORD_SUMMARY_CHANNEL` + `DISCORD_MILESTONE_CHANNEL` can be set to channel IDs for testing the scheduled messages, as well as the `DISCORD_BOT_TOKEN` to send the messages as.
- 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)).
- Optionally, `DISCORD_CAUSES_EMOJI` + `DISCORD_REGULAR_EMOJI` can be set to a JSON object mapping the cause names + regular emoji (see [`const regular` in `src/util/emoji.ts`](src/util//emoji.ts)) 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 @@ -26,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_CHANNEL` + `DISCORD_MILESTONE_CHANNEL` + `DISCORD_BOT_TOKEN` + `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 channel secrets can contain multiple IDs, separated by a comma).
You'll also want to set `DISCORD_CLIENT_ID` + `DISCORD_PUBLIC_KEY` + `STATS_API_ENDPOINT` (optionally, `DISCORD_SUMMARY_CHANNEL` + `DISCORD_MILESTONE_CHANNEL` + `DISCORD_BOT_TOKEN` + `DISCORD_CAUSES_EMOJI` + `DISCORD_REGULAR_EMOJI` + `WORKER_BASE_URL`) as secrets for the worker, which you can do with `npx wrangler secret put <var name> -e <staging/production>` (the channel secrets can contain multiple IDs, 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 62888f6

Please sign in to comment.