Skip to content
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

Breaking change about default channels #329

Merged
merged 4 commits into from Aug 3, 2017

Conversation

msciotti
Copy link
Contributor

No description provided.

foxbot added a commit to discord-net/Discord.Net that referenced this pull request Jul 31, 2017
Resolves #776

This change is inline with discord/discord-api-docs#329

RestGuild#DefaultChannelId is now obsolete and will throw a
NotSupportedException.
@msciotti msciotti changed the title Semi-breaking change about default channels Breaking change about default channels Jul 31, 2017

After today, we are removing the existing concept of a default channel from Discord. We saw a use case in many servers where the previously-default #general channel was being repurposed as an announcement-only, non-writable channel for new members. In practice, server owners were using bots to clear the entire message history of the default channel in order to change its purpose. Now that channel can simply be deleted and re-created with the desired permissions.

From now on, new servers will no longer have a default channel with the same snowflake id as its guild. Existing guilds are unaffected. This means that your library can no longer assume that channel as a default. The "default" channel for a given user is now the channel with the highest position that their permissions allow them to see.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing guilds are unaffected.

Does that mean that existing guilds will still have a default channel/not be able to delete the default channel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that needs clarification. It means that existing guilds will not have their #general channel id changed. It will, however, no longer be the default channel.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. Thank you for the clarification!

@@ -3,6 +3,12 @@
>danger
>API and Gateway versions below v6 will be discontinued on October 16, 2017, after which they will be non-functioning.

## July 31, 2017 - Breaking Change

After today, we are removing the existing concept of a default channel from Discord. We saw a use case in many servers where the previously-default #general channel was being repurposed as an announcement-only, non-writable channel for new members. In practice, server owners were using bots to clear the entire message history of the default channel in order to change its purpose. Now that channel can simply be deleted and re-created with the desired permissions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this first sentence is a bit misleading, perhaps we can clarify. we are not removing the concept of a default channel, just changing how "default" works.. so perhaps "changing how default channels function" might be better phrasing.

I also think we should drop the line about people using bots to clear the history, since the line before and after it offers enough context

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default now will also only apply to new joiners, with a users last open channel remembered across sessions, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.


After today, we are removing the existing concept of a default channel from Discord. We saw a use case in many servers where the previously-default #general channel was being repurposed as an announcement-only, non-writable channel for new members. In practice, server owners were using bots to clear the entire message history of the default channel in order to change its purpose. Now that channel can simply be deleted and re-created with the desired permissions.

From now on, new servers will no longer have a default channel with the same snowflake id as its guild. Existing guilds are unaffected. This means that your library can no longer assume that channel as a default. The "default" channel for a given user is now the channel with the highest position that their permissions allow them to see.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: snowflake is implied, so just ID would be fine

should also dictate that it is possible to not have a "default" channel if they have no permissions

@@ -48,6 +48,14 @@ Permissions follow a hierarchy with the following roles:
* Bots can only sort roles lower than their highest role.
* Bots can only kick/ban users of with a lower highest role than themselves.

In the case of permissions overlapping with each other—e.g. a user's role is banned from seeing a channel, but the user has a specific override—they are applied to a user in the following order:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should really be in a separate heading called ## Permission Calculation since hierarchy is just how your permissions on the guild respect the order of the roles list.

nit: would prefer moving the example to the end of the sentence, maybe wrapping in parens instead

In the case of permissions overlapping with each other—e.g. a user's role is banned from seeing a channel, but the user has a specific override—they are applied to a user in the following order:

1. Base permissions (@everyone) are applied
2. All permissions for the roles assigned to a user are applied
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be useful to clarify how these guild-level permissions are applied (roles are all ORed, hierarchy only matters for cases dictated above), but then again maybe that's obvious

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really weird. Git must have gotten messy - these changes shouldn't be here. Removing them.

@@ -3,6 +3,14 @@
>danger
>API and Gateway versions below v6 will be discontinued on October 16, 2017, after which they will be non-functioning.

## August 1, 2017 - Breaking Change

After today, we are changing how default channels function. The "default" channel for a given user is now the channel with the highest position that their permissions allow them to see. New guilds will no longer have a default channel with the same id as the guild. Existing guilds will not have their #general channel id changed. It is possible, if permissions are set in such a way, that a user will not have a default channel in a guild.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, this is the highest channel that the @everyone role can see right? The wording between here and stuff i've seen jake say isn't very clear on this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default channel is the first channel in the sorted channel list that a user can access. for a user joining that would probably be the @everyone role since they would not have a role assigned to them

@msciotti msciotti merged commit 2a15a70 into master Aug 3, 2017
@msciotti msciotti deleted the feature/RemoveDefaultChannels branch August 3, 2017 19:45
AlienIdeology added a commit to AlienIdeology/J-Cord that referenced this pull request Aug 4, 2017
z64 added a commit to discordrb/discordrb that referenced this pull request Aug 9, 2017
* reimplement Server#default_channel for breaking API change

Discord has updated their API to remove the previous concept of the "default channel" being the channel with the same snowflake ID as the guild. It is now described as ".. the channel with the highest position that their (the client) allows them to see (read)".
This change also allows "default channels" to be deleted and hidden just like any other channel.
discord/discord-api-docs#329

* removes special #default_channel handling in Channel#users
foxbot added a commit to discord-net/Discord.Net that referenced this pull request Aug 28, 2017
…777)

* Changed Guild#DefaultChannel to resolve the first accessible channel

Resolves #776

This change is inline with discord/discord-api-docs#329

RestGuild#DefaultChannelId is now obsolete and will throw a
NotSupportedException.

* RestGuild#DefaultChannelId will fall back to the guild ID

Adding an exception here would be a breaking change, so this was agreed
to fall back to the previous behavior, which would just return the guild
ID.
FiniteReality pushed a commit to FiniteReality/Discord.Net that referenced this pull request May 5, 2018
…iscord-net#777)

* Changed Guild#DefaultChannel to resolve the first accessible channel

Resolves discord-net#776

This change is inline with discord/discord-api-docs#329

RestGuild#DefaultChannelId is now obsolete and will throw a
NotSupportedException.

* RestGuild#DefaultChannelId will fall back to the guild ID

Adding an exception here would be a breaking change, so this was agreed
to fall back to the previous behavior, which would just return the guild
ID.
Levtastic added a commit to Levtastic/HypocrisyBot that referenced this pull request May 4, 2020
As of [#329](discord/discord-api-docs#329) the discord api no longer recognises "default channels" for servers.
Instead, we iterate through all channels to find the highest permission available.
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.

None yet

6 participants