diff --git a/src/gateway/client/dispatch.rs b/src/gateway/client/dispatch.rs index ae16e8d04f0..ecb5408884a 100644 --- a/src/gateway/client/dispatch.rs +++ b/src/gateway/client/dispatch.rs @@ -420,6 +420,7 @@ fn update_cache_with_event( FullEvent::ThreadCreate { thread: event.thread, + newly_created: event.newly_created, } }, Event::ThreadUpdate(mut event) => { diff --git a/src/gateway/client/event_handler.rs b/src/gateway/client/event_handler.rs index fa5d61a050f..3a05e4ff6b3 100644 --- a/src/gateway/client/event_handler.rs +++ b/src/gateway/client/event_handler.rs @@ -411,8 +411,8 @@ event_handler! { /// Dispatched when a thread is created or the current user is added to a private thread. /// - /// Provides the thread. - ThreadCreate { thread: GuildChannel } => async fn thread_create(&self, ctx: Context); + /// Provides the thread and if the thread was newly created. + ThreadCreate { thread: GuildChannel, newly_created: Option } => async fn thread_create(&self, ctx: Context); /// Dispatched when a thread is updated. /// diff --git a/src/model/event.rs b/src/model/event.rs index afa7c4e5e00..29b25d072dd 100644 --- a/src/model/event.rs +++ b/src/model/event.rs @@ -861,10 +861,11 @@ pub struct StageInstanceDeleteEvent { /// [Discord docs](https://discord.com/developers/docs/topics/gateway-events#thread-create). #[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))] #[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(transparent)] #[non_exhaustive] pub struct ThreadCreateEvent { + #[serde(flatten)] pub thread: GuildChannel, + pub newly_created: Option, } /// Requires [`GatewayIntents::GUILDS`].