Skip to content

Commit

Permalink
Remove deprecated interaction type aliases, field and method (serenit…
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelc authored and mkrasnitski committed Oct 24, 2023
1 parent 71229f4 commit c479dd4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 239 deletions.
11 changes: 0 additions & 11 deletions src/builder/create_application_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,6 @@ impl CreateApplicationCommand {
self
}

/// Specifies if the command should not be usable by default
///
/// **Note**: Setting it to false will disable it for anyone,
/// including administrators and guild owners.
#[deprecated(note = "replaced by `default_member_permissions`")]
pub fn default_permission(&mut self, default_permission: bool) -> &mut Self {
self.0.insert("default_permission", Value::from(default_permission));

self
}

/// Specifies the description of the application command.
///
/// **Note**: Must be between 1 and 100 characters long.
Expand Down
8 changes: 8 additions & 0 deletions src/model/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ pub mod component;
pub mod interaction;
pub mod oauth;

pub use interaction::{
Interaction,
InteractionResponseType,
InteractionType,
MessageFlags,
MessageInteraction,
};

use self::oauth::Scope;
use super::id::{snowflake, ApplicationId, GuildId, SkuId, UserId};
use super::user::User;
Expand Down
9 changes: 0 additions & 9 deletions src/model/application/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,10 @@ pub struct Command {
/// By default, commands are visible.
#[serde(default)]
pub dm_permission: Option<bool>,
/// Whether the command is enabled by default when
/// the application is added to a guild.
#[serde(default = "default_permission_value")]
#[deprecated(note = "replaced by `default_member_permissions`")]
pub default_permission: bool,
/// An autoincremented version identifier updated during substantial record changes.
pub version: CommandVersionId,
}

fn default_permission_value() -> bool {
true
}

#[cfg(feature = "http")]
impl Command {
/// Creates a global [`Command`],
Expand Down
189 changes: 0 additions & 189 deletions src/model/interactions.rs

This file was deleted.

8 changes: 0 additions & 8 deletions src/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ pub mod event;
pub mod gateway;
pub mod guild;
pub mod id;
#[deprecated(note = "use `model::application::interaction`")]
pub mod interactions;
pub mod invite;
pub mod mention;
pub mod misc;
Expand All @@ -43,12 +41,6 @@ pub mod user;
pub mod voice;
pub mod webhook;

#[deprecated(note = "use `model::application::oauth`")]
pub mod oauth2 {
#[deprecated(note = "use `model::application::oauth::Scope`")]
pub type OAuth2Scope = super::application::oauth::Scope;
}

use std::collections::HashMap;
use std::result::Result as StdResult;

Expand Down
43 changes: 21 additions & 22 deletions src/model/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,26 @@
//! ```rust,no_run
//! use serenity::model::prelude::*;
//! ```
#[doc(inline)]
pub use super::{
application::interaction::MessageFlags as InteractionApplicationCommandCallbackDataFlags,
application::interaction::*,
application::oauth::*,
application::*,
channel::MessageFlags,
channel::*,
connection::*,
event::*,
gateway::*,
guild::audit_log::*,
guild::*,
id::*,
invite::*,
mention::*,
misc::*,
permissions::*,
sticker::*,
user::*,
voice::*,
webhook::*,
pub use super::application::interaction::{
MessageFlags as InteractionApplicationCommandCallbackDataFlags,
*,
};
pub use super::application::oauth::*;
pub use super::application::*;
pub use super::channel::{MessageFlags, *};
pub use super::connection::*;
pub use super::event::*;
pub use super::gateway::*;
pub use super::guild::audit_log::*;
pub use super::guild::*;
pub use super::id::*;
pub use super::invite::*;
pub use super::mention::*;
pub use super::misc::*;
pub use super::permissions::*;
pub use super::sticker::*;
pub use super::user::*;
pub use super::voice::*;
pub use super::webhook::*;
pub use super::*;

0 comments on commit c479dd4

Please sign in to comment.