Skip to content

Commit

Permalink
refactor(gateway, http, model)!: remove deprecated apis (#2132)
Browse files Browse the repository at this point in the history
Remove all of the deprecated APIs:

- `twilight_gateway::EventTypeFlags::GUILD_BANS`
- `exec` on all `twilight_http` request builders
- `twilight_http::response::StatusCode::raw`
- `twilight_model::gateway::Intents::GUILD_BANS`
- `twilight_model::guild::GuildFeature::Commerce`
- `twilight_model::guild::GuildFeature::MonetizationEnabled`
- `twilight_model::oauth::current_application_info`
- `twilight_model::user::UserFlags::CERTIFIED_MODERATOR`
  • Loading branch information
zeylahellyer authored Feb 17, 2023
1 parent 5ac9eec commit 18fad87
Show file tree
Hide file tree
Showing 176 changed files with 3 additions and 1,070 deletions.
5 changes: 0 additions & 5 deletions twilight-gateway/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ bitflags! {
| Self::THREAD_LIST_SYNC.bits()
| Self::THREAD_MEMBER_UPDATE.bits()
| Self::THREAD_MEMBERS_UPDATE.bits();
/// All [`EventTypeFlags`] in [`Intents::GUILD_BANS`].
///
/// [`Intents::GUILD_BANS`]: crate::Intents::GUILD_BANS
#[deprecated(since = "0.14.3", note = "use the `GUILD_MODERATION` intent instead")]
const GUILD_BANS = Self::BAN_ADD.bits() | Self::BAN_REMOVE.bits() | Self::GUILD_AUDIT_LOG_ENTRY_CREATE.bits();
/// All [`EventTypeFlags`] in [`Intents::GUILD_MODERATION`].
///
/// [`Intents::GUILD_MODERATION`]: crate::Intents::GUILD_MODERATION
Expand Down
5 changes: 2 additions & 3 deletions twilight-http/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ mod interaction;

pub use self::{builder::ClientBuilder, interaction::InteractionClient};

use crate::request::GetCurrentAuthorizationInformation;
#[allow(deprecated)]
use crate::{
client::connector::Connector,
error::{Error, ErrorType},
Expand Down Expand Up @@ -78,7 +76,8 @@ use crate::{
GetCurrentUserGuildMember, GetCurrentUserGuilds, GetUser, LeaveGuild,
UpdateCurrentUser,
},
GetGateway, GetUserApplicationInfo, GetVoiceRegions, Method, Request,
GetCurrentAuthorizationInformation, GetGateway, GetUserApplicationInfo, GetVoiceRegions,
Method, Request,
},
response::ResponseFuture,
API_VERSION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ impl<'a> CreateGlobalChatInputCommand<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for CreateGlobalChatInputCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ impl<'a> CreateGlobalMessageCommand<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for CreateGlobalMessageCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ impl<'a> CreateGlobalUserCommand<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for CreateGlobalUserCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@ impl<'a> CreateGuildChatInputCommand<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for CreateGuildChatInputCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ impl<'a> CreateGuildMessageCommand<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for CreateGuildMessageCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ impl<'a> CreateGuildUserCommand<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for CreateGuildUserCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ impl<'a> DeleteGlobalCommand<'a> {
http,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<EmptyBody> {
self.into_future()
}
}

impl IntoFuture for DeleteGlobalCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ impl<'a> DeleteGuildCommand<'a> {
http,
}
}

#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<EmptyBody> {
self.into_future()
}
}

impl IntoFuture for DeleteGuildCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ impl<'a> GetCommandPermissions<'a> {
http,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<GuildCommandPermissions> {
self.into_future()
}
}

impl IntoFuture for GetCommandPermissions<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ impl<'a> GetGlobalCommand<'a> {
http,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for GetGlobalCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ impl<'a> GetGlobalCommands<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<ListBody<Command>> {
self.into_future()
}
}

impl IntoFuture for GetGlobalCommands<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ impl<'a> GetGuildCommand<'a> {
http,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for GetGuildCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ impl<'a> GetGuildCommandPermissions<'a> {
http,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<ListBody<GuildCommandPermissions>> {
self.into_future()
}
}

impl IntoFuture for GetGuildCommandPermissions<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ impl<'a> GetGuildCommands<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<ListBody<Command>> {
self.into_future()
}
}

impl IntoFuture for GetGuildCommands<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ impl<'a> SetGlobalCommands<'a> {
http,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<ListBody<Command>> {
self.into_future()
}
}

impl IntoFuture for SetGlobalCommands<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ impl<'a> SetGuildCommands<'a> {
http,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<ListBody<Command>> {
self.into_future()
}
}

impl IntoFuture for SetGuildCommands<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ impl<'a> UpdateCommandPermissions<'a> {
http,
})
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<ListBody<CommandPermission>> {
self.into_future()
}
}

impl IntoFuture for UpdateCommandPermissions<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ impl<'a> UpdateGlobalCommand<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for UpdateGlobalCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ impl<'a> UpdateGuildCommand<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Command> {
self.into_future()
}
}

impl IntoFuture for UpdateGuildCommand<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,6 @@ impl<'a> CreateFollowup<'a> {

self
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Message> {
self.into_future()
}
}

impl IntoFuture for CreateFollowup<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ impl<'a> CreateResponse<'a> {
http,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<EmptyBody> {
self.into_future()
}
}

impl IntoFuture for CreateResponse<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ impl<'a> DeleteFollowup<'a> {
application_id,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<EmptyBody> {
self.into_future()
}
}

impl IntoFuture for DeleteFollowup<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ impl<'a> DeleteResponse<'a> {
token,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<EmptyBody> {
self.into_future()
}
}

impl IntoFuture for DeleteResponse<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ impl<'a> GetFollowup<'a> {
interaction_token,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Message> {
self.into_future()
}
}

impl IntoFuture for GetFollowup<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ impl<'a> GetResponse<'a> {
token: interaction_token,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Message> {
self.into_future()
}
}

impl IntoFuture for GetResponse<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,6 @@ impl<'a> UpdateFollowup<'a> {

self
}

#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<EmptyBody> {
self.into_future()
}
}

impl IntoFuture for UpdateFollowup<'_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,6 @@ impl<'a> UpdateResponse<'a> {

self
}

#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<Message> {
self.into_future()
}
}

impl IntoFuture for UpdateResponse<'_> {
Expand Down
6 changes: 0 additions & 6 deletions twilight-http/src/request/channel/create_pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ impl<'a> CreatePin<'a> {
reason: None,
}
}

/// Execute the request, returning a future resolving to a [`Response`].
#[deprecated(since = "0.14.0", note = "use `.await` or `into_future` instead")]
pub fn exec(self) -> ResponseFuture<EmptyBody> {
self.into_future()
}
}

impl<'a> AuditLogReason<'a> for CreatePin<'a> {
Expand Down
Loading

0 comments on commit 18fad87

Please sign in to comment.