Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR lays the groundwork for a broader “API foundation” by expanding platform configuration, adding new API endpoints (read/write + OAuth), and extending database clients (Postgres/ClickHouse) to support those endpoints.
Changes:
- Add config structs + example config blocks for multiple third-party platforms (Discord/Spotify/Kick/AniList/Trakt/FFZ/7TV/BTTV/Steam).
- Introduce new API routes for channel listing, emote stats/history, command settings CRUD, user/channel settings updates, and multiple OAuth flows.
- Extend Postgres and ClickHouse clients with new query/update methods used by the new endpoints.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| uploader/uploader.go | Adds linter suppression on response writes. |
| redirects/redirects_test.go | Adds linter suppression in tests. |
| main.go | Blank-imports new route packages so init()-based route registration runs. |
| haste/haste.go | Adds linter suppression on response writes. |
| exampleconfig.json | Adds new platform configuration blocks to the example config. |
| common/utils/requests.go | Adds linter suppression on outbound HTTP request execution. |
| common/types.go | Adds new platform enums and new API response/data types for channels/emotes/reminders; expands settings structs. |
| common/db/redis.go | Adds linter suppression for default host string literal. |
| common/db/postgres.go | Adds new channel/settings/command-settings/reminders/OAuth token DB methods and small logic adjustments. |
| common/db/loops.go | Uses exec.CommandContext for backup command execution. |
| common/db/clickhouse.go | Adds ClickHouse emote stats and emote history query helpers + options struct. |
| common/config.go | Adds platform config structs and fields to the global config model. |
| api/routes/put/command_settings.go | Adds PUT upsert endpoint for command settings with auth checks. |
| api/routes/post/redirects.go | Adds linter suppression on response writes. |
| api/routes/patch/settings.go | Adds PATCH endpoints to update user and channel settings with authorization checks. |
| api/routes/get/login.go | Adds linter suppression on outbound HTTP request execution. |
| api/routes/get/emotes.go | Adds GET emote stats + emote history endpoints with filtering and pagination cursor support. |
| api/routes/get/command_settings.go | Adds authenticated GET endpoint for per-channel command settings with authorization checks. |
| api/routes/get/channels.go | Adds public GET endpoint returning all joined channels. |
| api/routes/get/auth.go | Adds OAuth / OpenID flows for multiple platforms (Discord/Spotify/Kick/AniList/Trakt/FFZ/Steam) plus helper utilities. |
| api/routes/del/command_settings.go | Adds DELETE endpoint intended to reset command overrides to defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Extract IsChannelAuthorized and GetTwitchPlatformID into api/middleware/authorize.go, replacing four separate identical implementations across get, del, put, and patch route packages.
There was a problem hiding this comment.
MISC: It would be cool to have a way to import this configuration data directly from the bot. That way, we don’t end up re-entering the same info over and over. A simple two-argument script placed in the bot's scripts folder could handle this seamlessly.

Platform Configs
exampleconfig.jsonwith all new platform blocksRead Routes
GET /channelsreturns all joined channelsGET /emotes/statsemote usage stats with optional filters and paginationGET /emotes/history/{login}recent emote history for a channelGET /channel/command-settingsfetch command overrides (auth required)Write Routes
PATCH /users/me/settingsupdate the authenticated users settingsPATCH /channels/me/settingsupdate a channels settings (broadcaster/ambassador/admin only)PUT /channel/command-settingsupsert command overrides for a channelDELETE /channel/command-settingsreset a command override back to defaultsDatabase
GetAllChannels,GetCommandSettings,GetChannelAmbassadors,GetEmoteStats,GetEmoteHistoryUpdateUserSettings,UpdateChannelSettings,UpsertCommandSettings,ResetCommandSettingsUpsertOAuthTokenAuth Routes
GET /auth/discord/authorize·GET /auth/discordredirect OAuth flow for DiscordGET /auth/discord/joinbot invite redirectGET /auth/spotify/authorize·GET /auth/spotifyredirect OAuth flow for SpotifyGET /auth/kick/authorize·GET /auth/kickPKCE OAuth flow for KickGET /auth/anilist/authorize·GET /auth/anilistredirect OAuth flow for AniListGET /auth/trakt/authorize·GET /auth/traktredirect OAuth flow for TraktGET /auth/ffz/authorize·GET /auth/ffzredirect OAuth flow for FFZGET /auth/steam/authorize·GET /auth/steamOpenID 2.0 flow for Steam