Skip to content

Commit

Permalink
Add missing guild_id to various events (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
NovusTheory authored Feb 5, 2020
1 parent f2d0ad5 commit 3ca41fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/model/channel/channel_category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use crate::http::Http;
pub struct ChannelCategory {
/// Id of this category.
pub id: ChannelId,
/// Guild Id this category belongs to.
pub guild_id: GuildId,
/// If this category belongs to another category.
#[serde(rename = "parent_id")]
pub category_id: Option<ChannelId>,
Expand Down Expand Up @@ -96,6 +98,7 @@ impl ChannelCategory {
cache_http.http().edit_channel(self.id.0, &map).map(|channel| {
let GuildChannel {
id,
guild_id,
category_id,
permission_overwrites,
nsfw,
Expand All @@ -107,6 +110,7 @@ impl ChannelCategory {

*self = ChannelCategory {
id,
guild_id,
category_id,
permission_overwrites,
nsfw,
Expand Down
6 changes: 6 additions & 0 deletions src/model/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ impl Serialize for ChannelDeleteEvent {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ChannelPinsUpdateEvent {
pub guild_id: Option<GuildId>,
pub channel_id: ChannelId,
pub last_pin_timestamp: Option<DateTime<FixedOffset>>,
#[serde(skip)]
Expand Down Expand Up @@ -888,6 +889,7 @@ impl Serialize for MessageCreateEvent {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MessageDeleteBulkEvent {
pub guild_id: Option<GuildId>,
pub channel_id: ChannelId,
pub ids: Vec<MessageId>,
#[serde(skip)]
Expand All @@ -896,6 +898,7 @@ pub struct MessageDeleteBulkEvent {

#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub struct MessageDeleteEvent {
pub guild_id: Option<GuildId>,
pub channel_id: ChannelId,
#[serde(rename = "id")] pub message_id: MessageId,
#[serde(skip)]
Expand All @@ -905,6 +908,7 @@ pub struct MessageDeleteEvent {
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MessageUpdateEvent {
pub id: MessageId,
pub guild_id: Option<GuildId>,
pub channel_id: ChannelId,
pub kind: Option<MessageType>,
pub content: Option<String>,
Expand Down Expand Up @@ -1156,6 +1160,7 @@ impl Serialize for ReactionRemoveEvent {

#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub struct ReactionRemoveAllEvent {
pub guild_id: Option<GuildId>,
pub channel_id: ChannelId,
pub message_id: MessageId,
#[serde(skip)]
Expand Down Expand Up @@ -1235,6 +1240,7 @@ pub struct ResumedEvent {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TypingStartEvent {
pub guild_id: Option<GuildId>,
pub channel_id: ChannelId,
pub timestamp: u64,
pub user_id: UserId,
Expand Down

0 comments on commit 3ca41fd

Please sign in to comment.