Skip to content

Feat: Add Discord Bot example project and improve Dependency Injection support#13

Merged
Ts-Pytham merged 10 commits into
masterfrom
feat/discord-bot
Jun 20, 2026
Merged

Feat: Add Discord Bot example project and improve Dependency Injection support#13
Ts-Pytham merged 10 commits into
masterfrom
feat/discord-bot

Conversation

@Ts-Pytham

Copy link
Copy Markdown
Owner

No description provided.

Ts-Pytham and others added 10 commits May 22, 2026 14:07
Implemented a Discord bot to interact with TikTok videos, including metadata retrieval and video downloads. Added multiple CDN providers (Cloudflare R2, 0x0.st, Litterbox) for video uploads exceeding Discord's size limit. Key changes include:

- Added `CloudflareR2CdnProvider`, `LitterboxCdnProvider`, and `ZeroXZeroCdnProvider` for CDN support.
- Introduced `CompositeCdnProvider` to handle fallback between multiple CDNs.
- Created `DownloadModule` and `VideoModule` for Discord interactions.
- Added `BotService` and `InteractionHandlerService` for bot lifecycle and command handling.
- Configured `appsettings.example.json` for bot and CDN settings.
- Updated solution to include the new `TiktokExplode.Bot` project.
- Added `GuildId` property in `BotSettings` to enable instant
  command registration in specific servers for development.
- Introduced `/audio` command in `VideoModule` to play TikTok
  video audio in voice channels using FFmpeg.
- Updated `Program.cs` to enable `GuildVoiceStates` intent
  and added `ConcurrentDictionary` for managing audio clients.
- Modified `InteractionHandlerService` to support guild-specific
  or global command registration based on `GuildId`.
- Created `FFmpegAudioStream` class to handle FFmpeg processes
  for audio streaming with proper resource disposal.
- Updated `appsettings.example.json` to include `GuildId`
  configuration with a default value of `0`.
Allows you to register an ISearchClient with UsePlaywrightSearch independently of the page fetcher, even when using HTTP.

Added TiktokDownloadClient as a singleton to share cookies and avoid 403 errors.
Improvements to search error handling, package version updates, added an icon to the metapackage, and internal visibility for testing. Minor refactoring for greater clarity.
@Ts-Pytham
Ts-Pytham merged commit a790436 into master Jun 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant