aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-09-09 14:19:09 +0200
committeracdenisSK <[email protected]>2017-09-09 14:19:09 +0200
commit870a2a5f821c9b0624cad03d873d04a8aad47082 (patch)
tree16fa4f0748b61fe189d4b47a184e6ee09cad7cc9 /src/model
parentImplement categories (diff)
downloadserenity-870a2a5f821c9b0624cad03d873d04a8aad47082.tar.xz
serenity-870a2a5f821c9b0624cad03d873d04a8aad47082.zip
`parent_id` -> `category_id`
Diffstat (limited to 'src/model')
-rw-r--r--src/model/channel/channel_category.rs7
-rw-r--r--src/model/channel/guild_channel.rs3
2 files changed, 6 insertions, 4 deletions
diff --git a/src/model/channel/channel_category.rs b/src/model/channel/channel_category.rs
index f8374fc..a0673fd 100644
--- a/src/model/channel/channel_category.rs
+++ b/src/model/channel/channel_category.rs
@@ -11,7 +11,8 @@ pub struct ChannelCategory {
/// Id of this category.
pub id: ChannelId,
/// If this category belongs to another category.
- pub parent_id: Option<ChannelId>,
+ #[serde(rename = "parent_id")]
+ pub category_id: Option<ChannelId>,
/// The position of this category.
pub position: i64,
/// Indicator of the type of channel this is.
@@ -103,9 +104,9 @@ impl ChannelCategory {
let edited = f(EditChannel(map)).0;
http::edit_channel(self.id.0, &edited).map(|channel| {
- let GuildChannel { id, parent_id, permission_overwrites, nsfw, name, position, kind, .. } = channel;
+ let GuildChannel { id, category_id, permission_overwrites, nsfw, name, position, kind, .. } = channel;
- *self = ChannelCategory { id, parent_id, permission_overwrites, nsfw, name, position, kind };
+ *self = ChannelCategory { id, category_id, permission_overwrites, nsfw, name, position, kind };
()
})
}
diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs
index b713e18..8ae50a6 100644
--- a/src/model/channel/guild_channel.rs
+++ b/src/model/channel/guild_channel.rs
@@ -25,7 +25,8 @@ pub struct GuildChannel {
/// The default channel Id shares the Id of the guild and the default role.
pub id: ChannelId,
/// Whether this guild channel belongs in a category.
- pub parent_id: Option<ChannelId>,
+ #[serde(rename = "parent_id")]
+ pub category_id: Option<ChannelId>,
/// The bitrate of the channel.
///
/// **Note**: This is only available for voice channels.