Enhance giveaway job handling and update environment configuration

- Added support for a new `giveawayCreate` job in the bot's job processing, allowing for giveaways to be created via the WebUI.
- Introduced `runGiveawayCreateJob` function to handle the creation of giveaways, ensuring consistent behavior with existing commands.
- Updated `.env.example` to clarify the usage of `BOT_TOKEN` for both the bot and WebUI, enhancing documentation for environment variables.
- Added `bullmq` dependency in the WebUI package for job management capabilities.
This commit is contained in:
smueller
2026-07-22 15:19:04 +02:00
parent 2ef6b23136
commit 677142672f
7 changed files with 133 additions and 5 deletions

View File

@@ -9,6 +9,14 @@ const EnvSchema = z.object({
REDIS_URL: z.string().url(),
BOT_CLIENT_ID: z.string().min(1),
BOT_CLIENT_SECRET: z.string().min(1),
/**
* Discord bot token. The WebUI does not run a discord.js Client/gateway
* connection, but uses this token for narrow, on-demand Discord REST calls
* (e.g. building a guild backup snapshot) and to enqueue BullMQ jobs that
* the bot process picks up for actions that require a live Client
* (posting messages, restoring a backup).
*/
BOT_TOKEN: z.string().min(1),
WEBUI_URL: z.string().url().default('http://localhost:3000'),
SESSION_SECRET: z.string().min(32, 'SESSION_SECRET must be at least 32 characters long'),
SENTRY_DSN: z.string().optional(),