Add Division-Specific Discord Roles, Announcement Channels, and Division Update API#65
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
yulmwu
commented
Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the Discord role assigned during account linking and the channel used for challenge solve announcements were both hardcoded.
This PR introduces support for configuring both the assigned Discord role and the solve announcement channel on a per-Division basis.
These values can now be specified when creating a Division. If either value is omitted, no action is taken for that setting. To support modifying these values after creation, a new Division update API has also been added.
As part of this change, the previously hardcoded environment variables for the Discord role ID and announcement channel ID have been removed.
For more details, please refer to the updated API documentation and the changes included in this PR.
List Divisions
GET /api/divisionsResponse 200
[ { "id": 2, "name": "고등부", "discord_role_id": "1522163303982563458", "discord_announce_channel_id": "1522218332806447225", "created_at": "2026-01-26T12:00:00Z" } ]Notes:
idvalues (slugs are not supported).discord_role_idanddiscord_announce_channel_idare the per-division Discordrole and announcement channel. They are omitted when unset and are managed by
admins via Create / Update Division. See Admin and Discord.
Create Division (Admin)
POST /api/admin/divisionsRequest
{ "name": "고등부", "discord_role_id": "1522163303982563458", "discord_announce_channel_id": "1522218332806447225" }discord_role_idanddiscord_announce_channel_idare optional.discord_role_idis the guild role granted to this division's members when they link Discord;
discord_announce_channel_idis the channel that receives this division's solve /first-blood announcements. Both are omitted from the response when unset.
Response 201
{ "id": 2, "name": "고등부", "discord_role_id": "1522163303982563458", "discord_announce_channel_id": "1522218332806447225", "created_at": "2026-01-26T12:00:00Z" }Errors:
invalid inputinvalid tokenormissing access_token cookieforbiddenValidation notes:
namemust be at most 10 characters (counted by Unicode code point).discord_role_id/discord_announce_channel_id, when present, must be numericDiscord IDs (snowflakes). An empty string clears the value.
Update Division (Admin)
PUT /api/admin/divisions/:idUpdates a division's name and per-division Discord configuration. Divisions cannot
be deleted.
Request
{ "name": "고등부", "discord_role_id": "1522163303982563458", "discord_announce_channel_id": "1522218332806447225" }Omitting (or sending an empty string for)
discord_role_id/discord_announce_channel_idclears that setting.Response 200
{ "id": 2, "name": "고등부", "discord_role_id": "1522163303982563458", "discord_announce_channel_id": "1522218332806447225", "created_at": "2026-01-26T12:00:00Z" }Errors:
invalid inputinvalid tokenormissing access_token cookieforbiddennot foundValidation notes: