Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,17 @@ mod create_channel;
mod create_embed;

#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
mod create_application_command;
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
mod create_application_command_permission;

mod bot_auth_parameters;
mod create_allowed_mentions;
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
mod create_components;
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
mod create_interaction_response;
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
mod create_interaction_response_followup;
mod create_invite;
mod create_message;
Expand All @@ -35,7 +30,6 @@ mod edit_guild;
mod edit_guild_welcome_screen;
mod edit_guild_widget;
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
mod edit_interaction_response;
mod edit_member;
mod edit_message;
Expand Down Expand Up @@ -74,7 +68,6 @@ pub use self::{
get_messages::GetMessages,
};
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub use self::{
create_application_command::{
CreateApplicationCommand,
Expand Down
4 changes: 0 additions & 4 deletions src/client/bridge/gateway/shard_messenger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ impl ShardMessenger {
/// Sets a new filter for an event collector.
#[inline]
#[cfg(feature = "collector")]
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
pub fn set_event_filter(&self, collector: EventFilter) {
#[allow(clippy::let_underscore_must_use)]
let _ = self.send_to_shard(ShardRunnerMessage::SetEventFilter(collector));
Expand All @@ -257,23 +256,20 @@ impl ShardMessenger {
/// Sets a new filter for a message collector.
#[inline]
#[cfg(feature = "collector")]
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
pub fn set_message_filter(&self, collector: MessageFilter) {
#[allow(clippy::let_underscore_must_use)]
let _ = self.send_to_shard(ShardRunnerMessage::SetMessageFilter(collector));
}

/// Sets a new filter for a reaction collector.
#[cfg(feature = "collector")]
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
pub fn set_reaction_filter(&self, collector: ReactionFilter) {
#[allow(clippy::let_underscore_must_use)]
let _ = self.send_to_shard(ShardRunnerMessage::SetReactionFilter(collector));
}

/// Sets a new filter for a component interaction collector.
#[cfg(all(feature = "unstable_discord_api", feature = "collector"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "unstable_discord_api", feature = "collector"))))]
pub fn set_component_interaction_filter(&self, collector: ComponentInteractionFilter) {
#[allow(clippy::let_underscore_must_use)]
let _ = self.send_to_shard(ShardRunnerMessage::SetComponentInteractionFilter(collector));
Expand Down
4 changes: 0 additions & 4 deletions src/client/bridge/gateway/shard_runner_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,14 @@ pub enum ShardRunnerMessage {
SetStatus(OnlineStatus),
/// Sends a new filter for events to the shard.
#[cfg(feature = "collector")]
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
SetEventFilter(EventFilter),
/// Sends a new filter for messages to the shard.
#[cfg(feature = "collector")]
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
SetMessageFilter(MessageFilter),
/// Sends a new filter for reactions to the shard.
#[cfg(feature = "collector")]
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
SetReactionFilter(ReactionFilter),
/// Sends a new filter for component interactions to the shard.
#[cfg(all(feature = "unstable_discord_api", feature = "collector"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "unstable_discord_api", feature = "collector"))))]
SetComponentInteractionFilter(ComponentInteractionFilter),
}
3 changes: 0 additions & 3 deletions src/client/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ impl Context {
/// sent back to `filter`'s paired receiver.
#[inline]
#[cfg(feature = "collector")]
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
pub async fn set_message_filter(&self, filter: MessageFilter) {
self.shard.set_message_filter(filter);
}
Expand All @@ -398,7 +397,6 @@ impl Context {
/// sent back to `filter`'s paired receiver.
#[inline]
#[cfg(feature = "collector")]
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
pub async fn set_reaction_filter(&self, filter: ReactionFilter) {
self.shard.set_reaction_filter(filter);
}
Expand All @@ -407,7 +405,6 @@ impl Context {
/// sent back to `filter`'s paired receiver.
#[inline]
#[cfg(all(feature = "unstable_discord_api", feature = "collector"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "unstable_discord_api", feature = "collector"))))]
pub async fn set_component_interaction_filter(&self, filter: ComponentInteractionFilter) {
self.shard.set_component_interaction_filter(filter);
}
Expand Down
7 changes: 0 additions & 7 deletions src/client/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,28 +428,24 @@ pub trait EventHandler: Send + Sync {
///
/// Provides the created interaction.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
async fn interaction_create(&self, _ctx: Context, _interaction: Interaction) {}

/// Dispatched when a guild integration is created.
///
/// Provides the created integration.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
async fn integration_create(&self, _ctx: Context, _integration: Integration) {}

/// Dispatched when a guild integration is updated.
///
/// Provides the updated integration.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
async fn integration_update(&self, _ctx: Context, _integration: Integration) {}

/// Dispatched when a guild integration is deleted.
///
/// Provides the integration's id, the id of the guild it belongs to, and its associated application id
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
async fn integration_delete(
&self,
_ctx: Context,
Expand All @@ -463,7 +459,6 @@ pub trait EventHandler: Send + Sync {
///
/// Provides the created application command.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
async fn application_command_create(
&self,
_ctx: Context,
Expand All @@ -475,7 +470,6 @@ pub trait EventHandler: Send + Sync {
///
/// Provides the updated application command.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
async fn application_command_update(
&self,
_ctx: Context,
Expand All @@ -487,7 +481,6 @@ pub trait EventHandler: Send + Sync {
///
/// Provides the deleted application command.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
async fn application_command_delete(
&self,
_ctx: Context,
Expand Down
23 changes: 0 additions & 23 deletions src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ impl Http {
///
/// Functions the same as [`Self::execute_webhook`]
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn create_followup_message(
&self,
interaction_token: &str,
Expand Down Expand Up @@ -476,7 +475,6 @@ impl Http {
///
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn create_global_application_command(
&self,
map: &Value,
Expand All @@ -493,7 +491,6 @@ impl Http {

/// Creates new global application commands.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn create_global_application_commands(
&self,
map: &Value,
Expand All @@ -510,7 +507,6 @@ impl Http {

/// Creates new guild application commands.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn create_guild_application_commands(
&self,
guild_id: u64,
Expand Down Expand Up @@ -579,7 +575,6 @@ impl Http {
///
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn create_guild_application_command(
&self,
guild_id: u64,
Expand Down Expand Up @@ -627,7 +622,6 @@ impl Http {
///
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#interaction-interaction-response
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn create_interaction_response(
&self,
interaction_id: u64,
Expand Down Expand Up @@ -823,7 +817,6 @@ impl Http {

/// Deletes a follow-up message for an interaction.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn delete_followup_message(
&self,
interaction_token: &str,
Expand All @@ -843,7 +836,6 @@ impl Http {

/// Deletes a global command.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn delete_global_application_command(&self, command_id: u64) -> Result<()> {
self.wind(204, Request {
body: None,
Expand All @@ -870,7 +862,6 @@ impl Http {

/// Deletes a guild command.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn delete_guild_application_command(
&self,
guild_id: u64,
Expand Down Expand Up @@ -990,7 +981,6 @@ impl Http {

/// Deletes the initial interaction response.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn delete_original_interaction_response(
&self,
interaction_token: &str,
Expand Down Expand Up @@ -1168,7 +1158,6 @@ impl Http {
///
/// [docs]: https://discord.com/developers/docs/resources/webhook#edit-webhook-message
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn edit_followup_message(
&self,
interaction_token: &str,
Expand All @@ -1195,7 +1184,6 @@ impl Http {
///
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#edit-global-application-command
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn edit_global_application_command(
&self,
command_id: u64,
Expand Down Expand Up @@ -1234,7 +1222,6 @@ impl Http {
///
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn edit_guild_application_command(
&self,
guild_id: u64,
Expand All @@ -1261,7 +1248,6 @@ impl Http {
///
/// [documentation]: https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn edit_guild_application_command_permissions(
&self,
guild_id: u64,
Expand All @@ -1288,7 +1274,6 @@ impl Http {
///
/// [documentation]: https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn edit_guild_application_commands_permissions(
&self,
guild_id: u64,
Expand Down Expand Up @@ -1445,7 +1430,6 @@ impl Http {

/// Gets the initial interaction response.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn get_original_interaction_response(
&self,
interaction_token: &str,
Expand All @@ -1467,7 +1451,6 @@ impl Http {
///
/// [docs]: https://discord.com/developers/docs/resources/webhook#edit-webhook-message
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn edit_original_interaction_response(
&self,
interaction_token: &str,
Expand Down Expand Up @@ -2311,7 +2294,6 @@ impl Http {

/// Fetches all of the global commands for your application.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn get_global_application_commands(&self) -> Result<Vec<ApplicationCommand>> {
self.fire(Request {
body: None,
Expand All @@ -2325,7 +2307,6 @@ impl Http {

/// Fetches a global commands for your application by its Id.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn get_global_application_command(
&self,
command_id: u64,
Expand Down Expand Up @@ -2367,7 +2348,6 @@ impl Http {

/// Fetches all of the guild commands for your application for a specific guild.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn get_guild_application_commands(
&self,
guild_id: u64,
Expand All @@ -2385,7 +2365,6 @@ impl Http {

/// Fetches a guild command by its Id.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn get_guild_application_command(
&self,
guild_id: u64,
Expand All @@ -2405,7 +2384,6 @@ impl Http {

/// Fetches all of the guild commands permissions for your application for a specific guild.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn get_guild_application_commands_permissions(
&self,
guild_id: u64,
Expand All @@ -2423,7 +2401,6 @@ impl Http {

/// Gives the guild command permission for your application for a specific guild.
#[cfg(feature = "unstable_discord_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
pub async fn get_guild_application_command_permissions(
&self,
guild_id: u64,
Expand Down
Loading