-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix breaking changes and bugs before release #793
Merged
Merged
Conversation
This file contains 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
The default argument can be reintroduced in the future, when the other overloads are removed.
NewsChannelBehavior was missing TopGuildMessageChannelBehavior as a supertype since ThreadParentChannelBehavior is no longer a TopGuildMessageChannelBehavior. TextChannelBehavior was missing TopGuildMessageChannelBehavior as a supertype since PrivateThreadParentChannelBehavior is no longer a TopGuildMessageChannelBehavior. ThreadParentChannelBehavior was extended to be a CategorizableChannelBehavior (implicating that ThreadParentChannel was als extended to be a CategorizableChannel) TextChannelBehavior's startPublicThread and startPrivateThread had an additional reason parameter added, breaking binary compatibility. The reason can be specified in the builder lambda. TextChannelBehavior.startPublicThreadWithMessage had the archiveDuration parameter removed, breaking binary compatibility.
There was binary incompatibility in Integration and missing Optional default values in IntegrationData.
Before ForumChannels would take the else path resulting in UnknownChannel events.
It's not serialized, so making it optional and nullable is useless.
They aren't queried through cache so putting them there doesn't make sense.
This preserves binary compatibility. Also add the old constructor.
They are not documented in Discord's docs and have odd behavior.
I want to make sure that the breaking changes were reverted by looking at the full diff in detail. I will tell you if I'm done with that and this PR is ready to merge (however, it is already ready to review). |
It was in TopGuildMessageChannelBehavior before but ForumChannels also support webhooks. In fact the only concrete Channel type that receives webhook support through this change is ForumChannel.
It is used in core and does not contain any optional fields.
ForumTagBuilder is no longer a AuditRequestBuilder, its reason was unused. The name property was also made var and public.
It's an internal function anyway, but make it more clear that it is starting a forum thread.
It is used in core and does not contain any optional fields.
Updating lastMessageId and message counts was combined into one update operation for MessageCreate. totalMessageSent is no longer decremented on MessageDelete and MessageDeleteBulk, the whole point of it is to not decrement.
Not having a default empty builder lambda in ForumChannelBehavior.startPublicThread will nudge users into thinking about what belongs in there. This is needed because you have to provide a message in that lambda to successfully create a forum post.
It was almost the same as ThreadModifyBuilder, just with an additional flags property, which was just copied over to ThreadModifyBuilder. Having a single builder for both cases is more maintainable and keeps the API simpler.
A message is always required. createMessage was renamed to message because a thread is started that just contains a message.
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.
Some breaking changes were discovered since the last release (e.g. here). This tries to revert those and includes some additional fixes.
The overload resolution ambiguity reported here was fixed.
NewsChannelBehavior
was missingTopGuildMessageChannelBehavior
as a supertype sinceThreadParentChannelBehavior
is no longer aTopGuildMessageChannelBehavior
.TextChannelBehavior
was missingTopGuildMessageChannelBehavior
as a supertype sincePrivateThreadParentChannelBehavior
is no longer aTopGuildMessageChannelBehavior
.ThreadParentChannelBehavior
was extended to be aCategorizableChannelBehavior
(implicating thatThreadParentChannel
was also extended to be aCategorizableChannel
).TextChannelBehavior
'sstartPublicThread
andstartPrivateThread
had an additionalreason
parameter added, breaking binary compatibility. The reason can be specified in the builder lambda.TextChannelBehavior.startPublicThreadWithMessage
had thearchiveDuration
parameter removed, breaking binary compatibility.Binary incompatibility in
Integration
was fixed.Missing
Optional
default values were added inIntegrationData
.The event type for
ForumChannel
s was changed fromUnknownChannel[Create|Update|Delete]Event
toForumChannel[Create|Update|Delete]Event
.Some optionalities and nullabilities were fixed.
Integration events now use
Integration
entities from core instead ofDiscordIntegration
from common.Audit Log Entries from
GuildAuditLogEntryCreate
events are no longer cached. They aren't queried through cache so putting them there doesn't make sense.Wrong
SerialName
annotation forcomponents
was removed.Old constructor of
StartThreadWithMessageBuilder
was reintroduced to preserve binary compatibility.StartThreadWithoutMessageBuilder
was renamed back toStartThreadBuilder
to preserve binary compatibility.Forum Tag routes and related declarations were removed because they are not documented in Discord's docs and have odd behavior. See the discussion here for details.
The serializer of
GuildMemberFlags
was made internal, it is accessible throughGuildMemberFlags.serializer()
.Some minor things were refactored and simplified.
The
asChannel
,asChannelOrNull
,fetchChannel
,fetchChannelOrNull
andwithStrategy
methods were overridden inForumChannel
andForumChannelBehavior
so they have the correct return type.The
Intents.IntentsBuilder.enableEvent
function was updated to add the right intent forForumChannel
events.Support for webhooks was moved up from
TopGuildMessageChannelBehavior
toCategorizableChannelBehavior
. This was done becauseForumChannel
s also support webhooks but are notTopGuildMessageChannel
s. The only concreteChannel
type that received webhook support by this change isForumChannel
.The
Discord
prefix was removed fromDiscordForumTag
andDiscordDefaultReaction
. These types are used in core and do not contain any optional fields.ForumTagBuilder
is no longer aAuditRequestBuilder
, itsreason
was unused. Thename
property was also madevar
andpublic
.Missing properties of
ThreadChannel
,ForumChannel
andTextChannel
were added.Message count caching was updated. Updating
lastMessageId
and message counts was combined into one update operation forMessageCreate
andtotalMessageSent
is no longer decremented onMessageDelete
andMessageDeleteBulk
, the whole point of it is to not decrement.The default value for the
builder
paremeter ofForumChannelBehavior.startPublicThread
was removed. Not having a default empty builder lambda in will nudge users into thinking about what belongs in there. This is needed because you have to provide a message in that lambda to successfully create a forum post.Removed
ForumThreadModifyBuilder
, it was almost the same asThreadModifyBuilder
, just with an additionalflags
property, which was just copied over toThreadModifyBuilder
instead.Having a single builder for both cases is more maintainable and keeps the API simpler.
StartForumThreadBuilder.message
was made non-nullable, as it is always required.StartForumThreadBuilder.createMessage
was also renamed tomessage
because a thread is started that just contains a message.The
builder
parameter ofChannelService.startThread
was accidentally unused.The full diff between the last release and this PR can be seen here to verify that the breaking changes were in fact reverted: 0.8.0-M17...5a805cc