Skip to content

Develop#20

Merged
M1tsumi merged 21 commits into
mainfrom
develop
Jun 15, 2026
Merged

Develop#20
M1tsumi merged 21 commits into
mainfrom
develop

Conversation

@M1tsumi

@M1tsumi M1tsumi commented May 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

@M1tsumi

M1tsumi commented May 14, 2026

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented May 14, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in commit 83e63c5. I merged origin/main into develop, resolved all merge conflicts, and verified the updated gateway code builds/tests cleanly.

M1tsumi added 8 commits May 13, 2026 21:15
Add CreateGuildExpressions (1UL << 43), CreateEvents (1UL << 44),

SetVoiceChannelStatus (1UL << 47), SendPolls (1UL << 48),

and UseExternalApps (1UL << 49) to Permissions enum.

Reference: https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
Add GuildVoiceChannelStatusUpdates intent (1 << 28) for VOICE_CHANNEL_STATUS_UPDATE events.

Include it in AllNonPrivileged composite flag.

Reference: https://discord.com/developers/docs/topics/gateway#gateway-intents
Add Poll (CreatePollRequest) and Attachments (List<Attachment>) to

InteractionCallbackData for interaction responses.

Add Status property to ModifyChannelRequest for voice channel status.

Reference: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure
Add GetVoiceChannelStatusAsync and SetVoiceChannelStatusAsync to

IDiscordRestClient interface and DiscordRestClient implementation.

GET /channels/{id}/voice-status returns current status string.

PATCH /channels/{id}/voice-status sets or clears the status.

Reference: https://discord.com/developers/docs/resources/channel#get-channel-status
Add AsDeferredChannelMessage() for type 5 (loading state) and

AsDeferredUpdateMessage() for type 6 (silent ACK) responses.

Fix Build() to exclude content/embeds/components from deferred

responses to avoid Discord API rejection.

Reference: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
Handle gateway close code 4015 (Voice server crashed) with

appropriate logging and reconnect behavior.

Add OnVoiceChannelStatusUpdate event dispatcher extensions for

strongly-typed VOICE_CHANNEL_STATUS_UPDATE event subscription.
Fix DiscordApiException to inherit from DiscordException for unified

exception hierarchy.

Add structured logging to MemoryCacheProvider for cache operations,

eviction, and health checks.

Update DI registration to inject logger into cache provider.

Replace all Debug.WriteLine calls in CommandsExtension with proper

ILogger LogError/LogWarning calls.
M1tsumi added 13 commits May 13, 2026 21:54
Fix blocking sync-over-async patterns in Dispose and StopListening methods across WebSocketConnection, EventDispatchQueue, and RedisCacheDistributor.

Replace all Debug.WriteLine calls with structured ILogger or remove from static extension methods where no logger is available (WebSocketConnection, ChannelExtensions, MessageExtensions, MLSGroupState).

Add GatewayCloseCode enum and replace magic close code numbers in GatewayClient switch statement for Discord API contract compliance.

Remove unnecessary null-forgiving operators in EventDispatcher.

Inject logger into WebSocketConnection and MLSGroupState constructors.
Add .ConfigureAwait(false) to every await expression in WebSocketConnection, EventDispatchQueue, EventDispatcher, HeartbeatManager, and GatewayClient to prevent deadlock risk in UI-threaded or ASP.NET consumer contexts.
…Cache async paths

Add .ConfigureAwait(false) to all await expressions in DiscordRestClient, RedisCacheProvider, CommandsExtension, and Interactivity extension methods to prevent deadlock risk in consumer contexts.
…nitions

Fixed CS0111 build error caused by duplicate OnVoiceChannelStatusUpdate method definitions in EventDispatcherExtensions.cs. The methods were defined twice (lines 679-686 and 1013-1020). Removed the duplicate definitions at lines 1008-1020, keeping the original async and sync overloads.
- VoiceClient.ConnectAsync now accepts DM/GroupDM channels (guildId=0)
- OnVoiceServerUpdate handles guild_id=0 by matching DM connections
- UdpReceiveLoopAsync checks DAVE before transport decryption
- KeepAliveLoopAsync is now started in ConnectInternalAsync
- External sender package (op 31) wired into MLS commit validation (HKDF binding)
- MLSState exposes MLS state for testing via internal property
- Added InternalsVisibleTo for Voice.Tests assembly
- Created DAVETestData helper generating valid MLS Welcome/Commit messages
- Unskipped all 16 previously-skipped DAVE tests (now use real crypto)
…ly scanning, connection state tracking, docs overhaul

This is a major development round following a comprehensive feature audit.
See CHANGELOG.md for the full breakdown.

Highlights:
- IDiscordClient interface (38KB, 130+ methods) for full testability
- Connection state tracking (ClientConnectionState enum, events, ReconnectAsync)
- Global exception handler infrastructure (SetupGlobalExceptionHandlers)
- Command module auto-discovery (UseCommandsWithAutoDiscovery, RegisterModulesInAssembly)
- Convenience methods: SendDirectMessageAsync, TrySendMessageAsync, TryReplyAsync, etc.
- Builder validation (token, intents, API version checks with actionable messages)
- XML doc code examples on 30+ methods across all public APIs
- Exception hierarchy consolidated (DiscordApiException unified, CacheException in tree)
- Error handling hardened — 15 empty catch blocks fixed, 4 fire-and-forget tasks tracked
- Gateway methods now propagate exceptions instead of silent swallowing
- Example bots fixed (ModerationBot, MusicBot, DashboardBot — all compile-clean)
- MIGRATION.md created, README.md rewritten, all docs updated and reconciled
- Security: TLS 1.2+ enforcement, token security warning, Ed25519 constant-time note
@M1tsumi M1tsumi merged commit cb1c5da into main Jun 15, 2026
2 of 3 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.

2 participants