{"id":28170953,"url":"https://github.com/raid-guild/undiscord","last_synced_at":"2025-05-15T18:15:37.871Z","repository":{"id":287075268,"uuid":"956781311","full_name":"raid-guild/unDiscord","owner":"raid-guild","description":"API endpoint to export Discord channels to HTML","archived":false,"fork":false,"pushed_at":"2025-04-18T15:16:56.000Z","size":773,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T06:56:29.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raid-guild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-28T21:13:23.000Z","updated_at":"2025-04-18T15:16:29.000Z","dependencies_parsed_at":"2025-04-09T21:22:03.044Z","dependency_job_id":"971357be-9a54-42e5-ae64-591c9707fac3","html_url":"https://github.com/raid-guild/unDiscord","commit_stats":null,"previous_names":["sunsakis/undiscord","raid-guild/undiscord"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raid-guild%2FunDiscord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raid-guild%2FunDiscord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raid-guild%2FunDiscord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raid-guild%2FunDiscord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raid-guild","download_url":"https://codeload.github.com/raid-guild/unDiscord/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394689,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-15T18:15:28.260Z","updated_at":"2025-05-15T18:15:37.857Z","avatar_url":"https://github.com/raid-guild.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Channel Exporter Service\n\nThis service provides an API endpoint that exports Discord channels to HTML using DiscordChatExporter and stores them in DigitalOcean Spaces. It's designed to work with the DungeonMaster bot for RaidGuild's channel archiving workflow.\n\n## Features\n\n- Export Discord channels to HTML using DiscordChatExporter CLI\n- Upload exported HTML files to DigitalOcean Spaces for permanent storage\n- Move exported channel to a Valhalla (archive) channel category\n- RESTful API for triggering exports\n- Secure environment variable configuration\n- Docker-based deployment\n\n## Prerequisites\n\n- Discord Bot Token with appropriate permissions\n- DigitalOcean Spaces account with access keys\n- Docker and Docker Compose (for local development)\n\n## Environment Variables\n\nCreate a `.env` file with the following variables:\n\n```\nVALHALLA_SITE=your_valhalla_site\n\n# Discord Bot Configuration\nDISCORD_API_TOKEN=your_discord_bot_token\nDISCORD_CLIENT_ID=your_discord_client_id\nDISCORD_GUILD_ID=your_guild_id\n\n# Discord Channel IDs\nDISCORD_VALHALLA_CATEGORY_ID=your_discord_valhalla_category_id\nDISCORD_COMMAND_CENTER_ID=your_discord_command_center_id\n\n# DigitalOcean Spaces Configuration\nDO_SPACES_KEY=your_spaces_key\nDO_SPACES_SECRET=your_spaces_secret\nDO_SPACES_ENDPOINT=https://nyc3.digitaloceanspaces.com\nDO_SPACES_BUCKET=your_bucket_name\n\n# Optional: Basic Auth (recommended for production)\nAPI_KEY=your_secure_random_api_key\n```\n\n## Local Development Setup\n\n1. Clone the repository:\n\n   ```\n   git clone \u003crepository-url\u003e\n   cd unDiscord\n   ```\n\n2. Create the `.env` file with your environment variables in the project root directory.\n\n3. Build and start the service with Docker Compose:\n\n   ```\n   docker-compose up --build\n   ```\n\n4. The service will be available at `http://localhost:8080`.\n\n## API Endpoints\n\n### Health Check\n\n```\nGET /health\n```\n\nReturns a 200 OK response if the service is running.\n\n### Export Channel\n\n```\nPOST /export\nContent-Type: application/json\nX-API-Key: your_api_key\n\n{\n  \"channelId\": \"your_discord_channel_id\",\n  \"guildId\": \"your_discord_guild_id\"\n}\n```\n\nThe `guildId` parameter is optional if you've set the `DISCORD_GUILD_ID` environment variable.\n\n### Response\n\nThe export endpoint returns a 202 Accepted response immediately and processes the export asynchronously:\n\n```json\n{\n  \"message\": \"Export started\",\n  \"channelId\": \"your_discord_channel_id\",\n  \"guildId\": \"your_discord_guild_id\"\n}\n```\n\nWhen the export is complete, the service will move the channel to a Valhalla (archive) channel category.\n\nIf the export fails, the channel of the attempted export will be notified.\n\n## Deployment Options\n\n### Using Docker Hub Image\n\nThe Discord Channel Exporter is available as a pre-built Docker image:\n\n```bash\ndocker pull sunsakis/discord-exporter:latest\n```\n\n## Troubleshooting\n\n### Common Issues\n\n- **Certificate Errors with DigitalOcean Spaces**: If you see TLS certificate errors, make sure you're using the correct endpoint URL and that the `forcePathStyle` option is enabled in the S3 client configuration.\n\n- **Discord API Rate Limits**: The DiscordChatExporter CLI can hit rate limits if you're exporting large channels or many channels in a short period. Consider adding delays between exports.\n\n- **Permission Errors**: Make sure your Discord bot has the necessary permissions to read the channels you're exporting.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraid-guild%2Fundiscord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraid-guild%2Fundiscord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraid-guild%2Fundiscord/lists"}