aboutsummaryrefslogtreecommitdiff
path: root/src/model/guild/mod.rs
diff options
context:
space:
mode:
authorKyle Clemens <[email protected]>2018-01-08 13:18:13 -0500
committeralex <[email protected]>2018-01-08 19:18:13 +0100
commit6587655bf90d662191538b11884311e5aff4b120 (patch)
treec27db8c664503cc9d18c49ce601ed66c06ce2fd7 /src/model/guild/mod.rs
parentSet a travis caching timeout of 900 seconds (diff)
downloadserenity-6587655bf90d662191538b11884311e5aff4b120.tar.xz
serenity-6587655bf90d662191538b11884311e5aff4b120.zip
Allow channels to be moved in and out of a category (#248)
Diffstat (limited to 'src/model/guild/mod.rs')
-rw-r--r--src/model/guild/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs
index d6cd75d..f514864 100644
--- a/src/model/guild/mod.rs
+++ b/src/model/guild/mod.rs
@@ -332,7 +332,7 @@ impl Guild {
///
/// // assuming a `guild` has already been bound
///
- /// let _ = guild.create_channel("my-test-channel", ChannelType::Text);
+ /// let _ = guild.create_channel("my-test-channel", ChannelType::Text, None);
/// ```
///
/// # Errors
@@ -343,7 +343,8 @@ impl Guild {
/// [`Channel`]: struct.Channel.html
/// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
/// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html
- pub fn create_channel(&self, name: &str, kind: ChannelType) -> Result<GuildChannel> {
+ pub fn create_channel<C>(&self, name: &str, kind: ChannelType, category: C) -> Result<GuildChannel>
+ where C: Into<Option<ChannelId>> {
#[cfg(feature = "cache")]
{
let req = Permissions::MANAGE_CHANNELS;
@@ -353,7 +354,7 @@ impl Guild {
}
}
- self.id.create_channel(name, kind)
+ self.id.create_channel(name, kind, category)
}
/// Creates an emoji in the guild with a name and base64-encoded image. The