diff options
| author | acdenisSK <[email protected]> | 2017-10-24 18:10:10 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-10-24 18:10:10 +0200 |
| commit | ef60c3cd5b93d61ff8200f5f6871b449bf7dccb5 (patch) | |
| tree | ff9ec9e09dc363c05c6b582380a120ca47290a9f /src/model/guild/mod.rs | |
| parent | Remove `on_` prefix to EventHandler tymethods (diff) | |
| parent | Fall back to `str::parse` if `parse_username` fails (diff) | |
| download | serenity-ef60c3cd5b93d61ff8200f5f6871b449bf7dccb5.tar.xz serenity-ef60c3cd5b93d61ff8200f5f6871b449bf7dccb5.zip | |
Merge v0.4.2
Diffstat (limited to 'src/model/guild/mod.rs')
| -rw-r--r-- | src/model/guild/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index a90445a..7aeb98f 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -600,6 +600,26 @@ impl Guild { self.id.edit_role(role_id, f) } + /// Edits the order of [`Role`]s + /// Requires the [Manage Roles] permission. + /// + /// # Examples + /// + /// Change the order of a role: + /// + /// ```rust,ignore + /// use serenity::model::RoleId; + /// guild.edit_role_position(RoleId(8), 2); + /// ``` + /// + /// [`Role`]: struct.Role.html + /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + #[inline] + pub fn edit_role_position<R>(&self, role_id: R, position: u64) -> Result<Vec<Role>> + where R: Into<RoleId> { + self.id.edit_role_position(role_id, position) + } + /// Gets a partial amount of guild data by its Id. /// /// Requires that the current user be in the guild. |