first commit

This commit is contained in:
Patrick
2026-05-01 18:51:04 +02:00
commit 82130fd898
13 changed files with 1162 additions and 0 deletions
+73
View File
@@ -0,0 +1,73 @@
# ZitateBot
Discord bot + web form for submitting quotes to different channels based on selected speaker.
## Features
- Dark-mode animated webpage
- Discord login required for quote submissions
- Speaker dropdown loaded from config
- Quote submission endpoint
- Discord embed posting to channel configured per speaker
- Optional mirror posting to a global latest channel
- Creator attribution is always included on quotes
- `/create-quote` command for Discord-side quote creation
- Optional file upload from web form with a public URL added to the quote
## Setup
1. Install dependencies.
2. In the Discord Developer Portal, set OAuth2 redirect URL to `http://localhost:3000/auth/discord/callback` (or your hosted URL).
3. Copy `.env.example` to `.env` and set bot + OAuth credentials.
4. Edit `config/quotes.config.json` with real channel IDs and allowed Discord user IDs.
5. Run config check and then start.
Set `DISCORD_GUILD_ID` in `.env` if you want `/create-quote` to appear quickly in one guild during setup.
```powershell
npm install
Copy-Item .env.example .env
npm run check
npm start
```
Then open `http://localhost:3000`.
## Config format
`config/quotes.config.json`
```json
{
"allowedSubmitterDiscordIds": ["111111111111111111"],
"latestChannelId": "222222222222222222",
"createQuoteChannelId": "333333333333333333",
"users": [
{
"id": "alice",
"displayName": "Alice",
"channelId": "123456789012345678",
"accentColor": 5793266,
"avatarUrl": "https://...optional"
}
]
}
```
## Notes
- Bot requires access to the configured channels.
- Only users in `allowedSubmitterDiscordIds` can submit quotes (web and `/create-quote`).
- If `latestChannelId` is set, every quote is also posted there.
- If `createQuoteChannelId` is set, `/create-quote` can only be used in that channel.
- Without `createQuoteChannelId`, `/create-quote` is allowed in channels named `create-quote`.
- Web form uploads are optional and stored in `uploads/` (served from `/uploads/<filename>`).
- Allowed web upload file types: images, video/audio files, `.txt`, `.pdf`, `.zip`, `.7z`, `.rar` (max 100 MB).
## Discord command quote creation
- Use `/create-quote` in your create-quote channel.
- Select `speaker` from the dropdown choices.
- Enter `quote` text in the command form.
- The quote is posted like web submissions and includes who created it.