Prevent DiscordClient from being inherited
Created by: uwx
Summary
Fixes an InvalidOperationException in the EventWaiter<T> constructor by disallowing something which should have never been allowed to begin with.
Details
This is the exception:
It is caused by enumerating DeclaredFields looking for an event field. When you inherit DiscordClient, all the event fields will be in the superclass, so DeclaredFields will not return anything useful. The only way around it would be really annoying, especially when you could just mark DiscordClient as sealed
and call it a day.
Changes proposed
- Add
sealed
modifier to DiscordClient
Notes
Untested