feat(api): support anonymous confession threads - #43
Merged
Merged
Conversation
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.
Adds first-class anonymous public thread support for confession channels, including
/thread,Apps > Reply as Anonymous Thread, thread-aware confession posting, approval dispatch, resend behavior, durable attachment handling, and Discord thread creation error reporting. Resolves #27.The PR also updates command registration and user docs so the new thread workflows, permissions, and attachment behavior are discoverable.
Implementation Notes
pending_channel_threadandapproved_channel_threadtables, plusconfession.pending_channel_thread_id, so thread creation can be represented before and after moderator approval./confess,/thread,Reply Anonymously, andReply as Anonymous Threadthrough the right channel/thread ids.message,new-thread, andnew-thread-reply. Empty modal state fields are parsed asnullso modal custom ids can represent optional thread and parent-message context without sentinel objects.DiscordErrorCodevalues and are converted into friendly user-facing interaction responses.create-discord-threadstep result asSerializedConfessionForProcess | string, usingtypeof result === 'string'to distinguish handled user-facing failures from successful prepared confession state.attachmentsandephemeral-attachments, including URL normalization and metadata extraction from Discord message attachments or embed images.discord.json, docs, and command registration helpers for/threadandReply as Anonymous Thread.Breaking Changes
None expected for users. A database migration is required to add thread-tracking tables and the nullable confession thread reference.
Test Cases
/threadmodal rejects existing-thread usage and missing public-thread/thread-message permissions.Reply as Anonymous Threadmodal rejects recursive thread replies, target-channel mismatches, and missing permissions./confessand anonymous reply modals resolve channel vs. thread destinations and enforce locked-thread permissions.null.