aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2017-01-25 08:02:08 -0800
committerAustin Hellyer <[email protected]>2017-01-25 08:02:08 -0800
commit5918d01ed69541e43aed0e62ee6eadbf5ebb20d2 (patch)
tree43125b22cfdae998f6bbc01e205ef159d4c5b903 /src/client
parentAdd guild chunking (diff)
downloadserenity-5918d01ed69541e43aed0e62ee6eadbf5ebb20d2.tar.xz
serenity-5918d01ed69541e43aed0e62ee6eadbf5ebb20d2.zip
Make Guild::create_channel return a GuildChannel
Instead of returning a generic `Channel` enum, make the following functions return an explicit GuildChannel instead of a more "generic" Channel enum: - Guild::create_channel - GuildId::create_channel - PartialGuild::create_channel - rest::create_channel
Diffstat (limited to 'src/client')
-rw-r--r--src/client/rest/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/rest/mod.rs b/src/client/rest/mod.rs
index 66ba043..639b901 100644
--- a/src/client/rest/mod.rs
+++ b/src/client/rest/mod.rs
@@ -204,14 +204,14 @@ pub fn broadcast_typing(channel_id: u64) -> Result<()> {
/// [`GuildChannel`]: ../../model/struct.GuildChannel.html
/// [docs]: https://discordapp.com/developers/docs/resources/guild#create-guild-channel
/// [Manage Channels]: ../../model/permissions/constant.MANAGE_CHANNELS.html
-pub fn create_channel(guild_id: u64, map: Value) -> Result<Channel> {
+pub fn create_channel(guild_id: u64, map: Value) -> Result<GuildChannel> {
let body = serde_json::to_string(&map)?;
let response = request!(Route::GuildsIdChannels(guild_id),
post(body),
"/guilds/{}/channels",
guild_id);
- Channel::decode(serde_json::from_reader(response)?)
+ GuildChannel::decode(serde_json::from_reader(response)?)
}
/// Creates an emoji in the given [`Guild`] with the given data.