Skip to content

Commit 3dc1644

Browse files
committed
Remove InteractionResponseFlags
This is just a duplicate of MessageFlags and having this duplicate impl for the same flags just adds extra complexity for poise, we don't usually wrap like this in other places like serenity, so I replaced it with MessageFlags
1 parent 54da464 commit 3dc1644

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

examples/testing/src/model_type_sizes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ pub fn print_ranking() {
104104
("IntegrationDeleteEvent", std::mem::size_of::<IntegrationDeleteEvent>()),
105105
("IntegrationId", std::mem::size_of::<IntegrationId>()),
106106
("IntegrationUpdateEvent", std::mem::size_of::<IntegrationUpdateEvent>()),
107-
("InteractionResponseFlags", std::mem::size_of::<InteractionResponseFlags>()),
108107
("InteractionCreateEvent", std::mem::size_of::<InteractionCreateEvent>()),
109108
("InteractionId", std::mem::size_of::<InteractionId>()),
110109
("Invite", std::mem::size_of::<Invite>()),

src/builder/create_interaction_response.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub struct CreateInteractionResponseMessage<'a> {
155155
#[serde(skip_serializing_if = "Option::is_none")]
156156
allowed_mentions: Option<CreateAllowedMentions<'a>>,
157157
#[serde(skip_serializing_if = "Option::is_none")]
158-
flags: Option<InteractionResponseFlags>,
158+
flags: Option<MessageFlags>,
159159
#[serde(skip_serializing_if = "Option::is_none")]
160160
#[cfg(feature = "unstable")]
161161
components: Option<Cow<'a, [CreateComponent<'a>]>>,
@@ -254,19 +254,19 @@ impl<'a> CreateInteractionResponseMessage<'a> {
254254
}
255255

256256
/// Sets the flags for the message.
257-
pub fn flags(mut self, flags: InteractionResponseFlags) -> Self {
257+
pub fn flags(mut self, flags: MessageFlags) -> Self {
258258
self.flags = Some(flags);
259259
self
260260
}
261261

262262
/// Adds or removes the ephemeral flag.
263263
pub fn ephemeral(mut self, ephemeral: bool) -> Self {
264-
let mut flags = self.flags.unwrap_or_else(InteractionResponseFlags::empty);
264+
let mut flags = self.flags.unwrap_or_else(MessageFlags::empty);
265265

266266
if ephemeral {
267-
flags |= InteractionResponseFlags::EPHEMERAL;
267+
flags |= MessageFlags::EPHEMERAL;
268268
} else {
269-
flags &= !InteractionResponseFlags::EPHEMERAL;
269+
flags &= !MessageFlags::EPHEMERAL;
270270
}
271271

272272
self.flags = Some(flags);

src/model/application/interaction.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -299,23 +299,6 @@ enum_number! {
299299
}
300300
}
301301

302-
bitflags! {
303-
/// The flags for an interaction response message.
304-
///
305-
/// [Discord docs](https://discord.com/developers/docs/resources/channel#message-object-message-flags)
306-
/// ([only some are valid in this context](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-messages))
307-
#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialEq)]
308-
pub struct InteractionResponseFlags: u64 {
309-
/// Do not include any embeds when serializing this message.
310-
const SUPPRESS_EMBEDS = 1 << 2;
311-
/// Interaction message will only be visible to sender and will
312-
/// be quickly deleted.
313-
const EPHEMERAL = 1 << 6;
314-
/// Does not trigger push notifications or desktop notifications.
315-
const SUPPRESS_NOTIFICATIONS = 1 << 12;
316-
}
317-
}
318-
319302
/// A cleaned up enum for determining the authorizing owner for an [`Interaction`].
320303
///
321304
/// [Discord Docs](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object)

0 commit comments

Comments
 (0)