diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs index d174eacf4d1..c0eb5a7a7c5 100644 --- a/src/model/channel/mod.rs +++ b/src/model/channel/mod.rs @@ -342,6 +342,9 @@ pub struct PermissionOverwrite { /// /// This is for use with methods such as [`GuildChannel::create_permission`]. /// +/// If you would like to modify the default permissions of a channel, you can get its [`RoleId`] +/// from [`GuildId::everyone_role`]. +/// /// [Discord docs](https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure) (field `type`). #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[non_exhaustive] diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs index 24cfab16cff..11f1415edfc 100644 --- a/src/model/guild/guild_id.rs +++ b/src/model/guild/guild_id.rs @@ -868,6 +868,13 @@ impl GuildId { Ok(roles.into_iter().map(|r| (r.id, r)).collect()) } + /// Gets the default permission role (@everyone) from the guild. + #[inline] + #[must_use] + pub fn everyone_role(&self) -> RoleId { + RoleId::from(self.get()) + } + /// Tries to find the [`Guild`] by its Id in the cache. #[cfg(feature = "cache")] #[inline]