Skip to content

Commit 8dacfe8

Browse files
committed
Remove recently deprecated items
1 parent 76dcaac commit 8dacfe8

File tree

10 files changed

+11
-71
lines changed

10 files changed

+11
-71
lines changed

examples/testing/src/model_type_sizes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ pub fn print_ranking() {
125125
("MessageFlags", std::mem::size_of::<MessageFlags>()),
126126
("MessageFlags", std::mem::size_of::<MessageFlags>()),
127127
("MessageId", std::mem::size_of::<MessageId>()),
128-
("MessageInteraction", std::mem::size_of::<MessageInteraction>()),
129128
("MessageReaction", std::mem::size_of::<MessageReaction>()),
130129
("MessageReference", std::mem::size_of::<MessageReference>()),
131130
("MessageUpdateEvent", std::mem::size_of::<MessageUpdateEvent>()),

src/builder/create_command.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ pub struct CreateCommand<'a> {
338338
#[serde(skip_serializing_if = "Option::is_none")]
339339
default_member_permissions: Option<Permissions>,
340340
#[serde(skip_serializing_if = "Option::is_none")]
341+
#[cfg(not(feature = "unstable"))]
341342
dm_permission: Option<bool>,
342343
#[serde(skip_serializing_if = "Option::is_none")]
343344
#[serde(rename = "type")]
@@ -362,6 +363,7 @@ impl<'a> CreateCommand<'a> {
362363
description: None,
363364
description_localizations: HashMap::new(),
364365
default_member_permissions: None,
366+
#[cfg(not(feature = "unstable"))]
365367
dm_permission: None,
366368

367369
#[cfg(feature = "unstable")]
@@ -416,7 +418,7 @@ impl<'a> CreateCommand<'a> {
416418
}
417419

418420
/// Specifies if the command is available in DMs.
419-
#[cfg_attr(feature = "unstable", deprecated = "Use contexts instead")]
421+
#[cfg(not(feature = "unstable"))]
420422
pub fn dm_permission(mut self, enabled: bool) -> Self {
421423
self.dm_permission = Some(enabled);
422424
self

src/client/dispatch.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,6 @@ fn update_cache_with_event(
314314
event,
315315
}
316316
},
317-
#[allow(deprecated)]
318-
Event::PresencesReplace(event) => FullEvent::PresenceReplace {
319-
presences: event.presences.into_vec(),
320-
},
321317
Event::PresenceUpdate(mut event) => {
322318
let old_data = if_cache!(event.update(cache));
323319

src/client/event_handler.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ event_handler! {
329329
/// Provides the channel's id and the message's id.
330330
ReactionRemoveEmoji { removed_reactions: Reaction } => async fn reaction_remove_emoji(&self, ctx: Context);
331331

332-
#[deprecated = "This event does not exist"]
333-
PresenceReplace { presences: Vec<Presence> } => async fn presence_replace(&self, ctx: Context);
334-
335332
/// Dispatched when a user's presence is updated (e.g off -> on).
336333
///
337334
/// Provides the presence's new data, as well as the old presence data if the

src/model/application/command.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ pub struct Command {
7676
/// Indicates whether the command is available in DMs with the app, only for globally-scoped
7777
/// commands. By default, commands are visible.
7878
#[serde(default)]
79-
#[cfg_attr(
80-
all(not(ignore_serenity_deprecated), feature = "unstable_discord_api"),
81-
deprecated = "Use Command::contexts"
82-
)]
79+
#[cfg(not(feature = "unstable"))]
8380
pub dm_permission: Option<bool>,
8481
/// Indicates whether the command is [age-restricted](https://discord.com/developers/docs/interactions/application-commands#agerestricted-commands),
8582
/// defaults to false.

src/model/application/interaction.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use serde_json::from_value;
66
use super::InstallationContext;
77
use super::{CommandInteraction, ComponentInteraction, ModalInteraction, PingInteraction};
88
use crate::internal::prelude::*;
9+
#[cfg(not(feature = "unstable"))]
910
use crate::model::guild::PartialMember;
1011
use crate::model::id::{ApplicationId, InteractionId};
1112
#[cfg(feature = "unstable")]
@@ -400,10 +401,7 @@ impl serde::Serialize for AuthorizingIntegrationOwners {
400401
/// [`Message`]: crate::model::channel::Message
401402
///
402403
/// [Discord docs](https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object).
403-
#[cfg_attr(
404-
all(not(ignore_serenity_deprecated), feature = "unstable_discord_api"),
405-
deprecated = "Use Message::interaction_metadata"
406-
)]
404+
#[cfg(not(feature = "unstable"))]
407405
#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
408406
#[derive(Clone, Debug, Deserialize, Serialize)]
409407
#[non_exhaustive]

src/model/application/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ pub struct Team {
152152
pub struct TeamMember {
153153
/// The member's membership state.
154154
pub membership_state: MembershipState,
155-
/// The list of permissions of the member on the team.
156-
///
157-
/// NOTE: Will always be "*" for now.
158-
#[deprecated = "This field is not sent by the API anymore"]
159-
pub permissions: FixedArray<String>,
160155
/// The ID of the team they are a member of.
161156
pub team_id: GenericId,
162157
/// The user type of the team member.

src/model/channel/message.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ pub struct Message {
107107
pub flags: Option<MessageFlags>,
108108
/// The message that was replied to using this message.
109109
pub referenced_message: Option<Box<Message>>, // Boxed to avoid recursion
110-
#[cfg_attr(
111-
all(not(ignore_serenity_deprecated), feature = "unstable_discord_api"),
112-
deprecated = "Use interaction_metadata"
113-
)]
110+
#[cfg(not(feature = "unstable"))]
114111
pub interaction: Option<Box<MessageInteraction>>,
115112
/// Sent if the message is a response to an [`Interaction`].
116113
///
@@ -197,13 +194,6 @@ impl Message {
197194
self.channel_id.to_channel(cache_http).await
198195
}
199196

200-
/// A util function for determining whether this message was sent by someone else, or the bot.
201-
#[cfg(feature = "cache")]
202-
#[deprecated = "Check Message::author is equal to Cache::current_user"]
203-
pub fn is_own(&self, cache: &Cache) -> bool {
204-
self.author.id == cache.current_user().id
205-
}
206-
207197
/// Deletes the message.
208198
///
209199
/// **Note**: The logged in user must either be the author of the message or have the [Manage
@@ -377,17 +367,6 @@ impl Message {
377367
cache.guild(self.guild_id?)
378368
}
379369

380-
/// True if message was sent using direct messages.
381-
///
382-
/// **Only use this for messages from the gateway (event handler)!** Not for returned Message
383-
/// objects from HTTP requests, like [`ChannelId::send_message`], because [`Self::guild_id`] is
384-
/// never set for those, which this method relies on.
385-
#[must_use]
386-
#[deprecated = "Check if guild_id is None if the message is received from the gateway."]
387-
pub fn is_private(&self) -> bool {
388-
self.guild_id.is_none()
389-
}
390-
391370
/// Retrieves a clone of the author's Member instance, if this message was sent in a guild.
392371
///
393372
/// If the instance cannot be found in the cache, or the `cache` feature is disabled, a HTTP

src/model/event.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -521,11 +521,8 @@ pub struct MessageUpdateEvent {
521521
pub flags: Option<Option<MessageFlags>>,
522522
#[serde(default, deserialize_with = "deserialize_some")]
523523
pub referenced_message: Option<Option<Box<Message>>>,
524-
#[cfg_attr(
525-
all(not(ignore_serenity_deprecated), feature = "unstable_discord_api"),
526-
deprecated = "Use interaction_metadata"
527-
)]
528524
#[serde(default, deserialize_with = "deserialize_some")]
525+
#[cfg(not(feature = "unstable"))]
529526
pub interaction: Option<Option<Box<MessageInteraction>>>,
530527
#[cfg(feature = "unstable")]
531528
pub interaction_metadata: Option<Option<Box<MessageInteractionMetadata>>>,
@@ -570,6 +567,7 @@ impl MessageUpdateEvent {
570567
message_reference,
571568
flags,
572569
referenced_message,
570+
#[cfg(not(feature = "unstable"))]
573571
interaction,
574572
#[cfg(feature = "unstable")]
575573
interaction_metadata,
@@ -609,6 +607,7 @@ impl MessageUpdateEvent {
609607
if let Some(x) = message_reference { message.message_reference.clone_from(x) }
610608
if let Some(x) = flags { message.flags.clone_from(x) }
611609
if let Some(x) = referenced_message { message.referenced_message.clone_from(x) }
610+
#[cfg(not(feature = "unstable"))]
612611
if let Some(x) = interaction { message.interaction.clone_from(x) }
613612
#[cfg(feature = "unstable")]
614613
if let Some(x) = interaction_metadata { message.interaction_metadata.clone_from(x) }
@@ -633,16 +632,6 @@ pub struct PresenceUpdateEvent {
633632
pub presence: Presence,
634633
}
635634

636-
/// Not officially documented.
637-
#[cfg_attr(not(ignore_serenity_deprecated), deprecated = "This event doesn't exist")]
638-
#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
639-
#[derive(Clone, Debug, Deserialize, Serialize)]
640-
#[serde(transparent)]
641-
#[non_exhaustive]
642-
pub struct PresencesReplaceEvent {
643-
pub presences: FixedArray<Presence>,
644-
}
645-
646635
/// Requires [`GatewayIntents::GUILD_MESSAGE_REACTIONS`] or
647636
/// [`GatewayIntents::DIRECT_MESSAGE_REACTIONS`].
648637
///
@@ -1246,9 +1235,6 @@ pub enum Event {
12461235
MessageUpdate(MessageUpdateEvent),
12471236
/// A member's presence state (or username or avatar) has changed
12481237
PresenceUpdate(PresenceUpdateEvent),
1249-
/// The presence list of the user's friends should be replaced entirely
1250-
#[cfg_attr(not(ignore_serenity_deprecated), deprecated = "This event doesn't exist")]
1251-
PresencesReplace(PresencesReplaceEvent),
12521238
/// A reaction was added to a message.
12531239
///
12541240
/// Fires the [`EventHandler::reaction_add`] event handler.

src/model/guild/mod.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use crate::builder::{
5151
};
5252
#[cfg(feature = "collector")]
5353
use crate::collector::{MessageCollector, ReactionCollector};
54-
#[cfg(feature = "model")]
54+
#[cfg(doc)]
5555
use crate::constants::LARGE_THRESHOLD;
5656
#[cfg(feature = "collector")]
5757
use crate::gateway::ShardMessenger;
@@ -1388,15 +1388,6 @@ impl Guild {
13881388
self.id.invites(http).await
13891389
}
13901390

1391-
/// Checks if the guild is 'large'.
1392-
///
1393-
/// A guild is considered large if it has more than 250 members.
1394-
#[must_use]
1395-
#[deprecated = "Use Guild::large"]
1396-
pub fn is_large(&self) -> bool {
1397-
self.member_count > u64::from(LARGE_THRESHOLD)
1398-
}
1399-
14001391
/// Kicks a [`Member`] from the guild.
14011392
///
14021393
/// Requires the [Kick Members] permission.

0 commit comments

Comments
 (0)