diff options
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/builder/edit_guild.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils/builder/edit_guild.rs b/src/utils/builder/edit_guild.rs index 43e93da..83d5016 100644 --- a/src/utils/builder/edit_guild.rs +++ b/src/utils/builder/edit_guild.rs @@ -1,7 +1,7 @@ use serde_json::builder::ObjectBuilder; use serde_json::Value; use std::default::Default; -use ::model::{ChannelId, Region, VerificationLevel}; +use ::model::{ChannelId, Region, UserId, VerificationLevel}; /// A builder to optionally edit certain fields of a [`Guild`]. This is meant /// for usage with [`Context::edit_guild`] and [`LiveGuild::edit`]. @@ -72,6 +72,13 @@ impl EditGuild { EditGuild(self.0.insert("name", name)) } + /// Transfers the ownership of the guild to another user by Id. + /// + /// **Note**: The current user must be the owner of the guild. + pub fn owner<U: Into<UserId>>(self, user_id: U) -> Self { + EditGuild(self.0.insert("owner_id", user_id.into().0)) + } + /// Set the voice region of the server. /// /// # Examples |