Skip to content

Commit d6b9b28

Browse files
authored
Remove broken Message::super_react (#3063)
1 parent 4b9756c commit d6b9b28

File tree

2 files changed

+7
-67
lines changed

2 files changed

+7
-67
lines changed

src/http/client.rs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -836,12 +836,12 @@ impl Http {
836836
.await
837837
}
838838

839-
async fn create_reaction_(
839+
/// Reacts to a message.
840+
pub async fn create_reaction(
840841
&self,
841842
channel_id: ChannelId,
842843
message_id: MessageId,
843844
reaction_type: &ReactionType,
844-
burst: bool,
845845
) -> Result<()> {
846846
self.wind(204, Request {
847847
body: None,
@@ -853,31 +853,10 @@ impl Http {
853853
message_id,
854854
reaction: &reaction_type.as_data(),
855855
},
856-
params: Some(vec![("burst", burst.to_string())]),
856+
params: None,
857857
})
858858
.await
859859
}
860-
861-
/// Reacts to a message.
862-
pub async fn create_reaction(
863-
&self,
864-
channel_id: ChannelId,
865-
message_id: MessageId,
866-
reaction_type: &ReactionType,
867-
) -> Result<()> {
868-
self.create_reaction_(channel_id, message_id, reaction_type, false).await
869-
}
870-
871-
/// Super reacts to a message.
872-
pub async fn create_super_reaction(
873-
&self,
874-
channel_id: ChannelId,
875-
message_id: MessageId,
876-
reaction_type: &ReactionType,
877-
) -> Result<()> {
878-
self.create_reaction_(channel_id, message_id, reaction_type, true).await
879-
}
880-
881860
/// Creates a role.
882861
pub async fn create_role(
883862
&self,

src/model/channel/message.rs

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -573,35 +573,13 @@ impl Message {
573573
cache_http: impl CacheHttp,
574574
reaction_type: impl Into<ReactionType>,
575575
) -> Result<Reaction> {
576-
self.react_(cache_http, reaction_type.into(), false).await
577-
}
578-
579-
/// React to the message with a custom [`Emoji`] or unicode character.
580-
///
581-
/// **Note**: Requires [Add Reactions] and [Use External Emojis] permissions.
582-
///
583-
/// # Errors
584-
///
585-
/// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] if the current user
586-
/// does not have the required [permissions].
587-
///
588-
/// [Add Reactions]: Permissions::ADD_REACTIONS
589-
/// [Use External Emojis]: Permissions::USE_EXTERNAL_EMOJIS
590-
/// [permissions]: crate::model::permissions
591-
#[inline]
592-
pub async fn super_react(
593-
&self,
594-
cache_http: impl CacheHttp,
595-
reaction_type: impl Into<ReactionType>,
596-
) -> Result<Reaction> {
597-
self.react_(cache_http, reaction_type.into(), true).await
576+
self.react_(cache_http, reaction_type.into()).await
598577
}
599578

600579
async fn react_(
601580
&self,
602581
cache_http: impl CacheHttp,
603582
reaction_type: ReactionType,
604-
burst: bool,
605583
) -> Result<Reaction> {
606584
#[cfg_attr(not(feature = "cache"), allow(unused_mut))]
607585
let mut user_id = None;
@@ -615,30 +593,13 @@ impl Message {
615593
self.channel_id,
616594
Permissions::ADD_REACTIONS,
617595
)?;
618-
619-
if burst {
620-
utils::user_has_perms_cache(
621-
cache,
622-
self.channel_id,
623-
Permissions::USE_EXTERNAL_EMOJIS,
624-
)?;
625-
}
626596
}
627597

628598
user_id = Some(cache.current_user().id);
629599
}
630600
}
631601

632-
let reaction_types = if burst {
633-
cache_http
634-
.http()
635-
.create_super_reaction(self.channel_id, self.id, &reaction_type)
636-
.await?;
637-
ReactionTypes::Burst
638-
} else {
639-
cache_http.http().create_reaction(self.channel_id, self.id, &reaction_type).await?;
640-
ReactionTypes::Normal
641-
};
602+
cache_http.http().create_reaction(self.channel_id, self.id, &reaction_type).await?;
642603

643604
Ok(Reaction {
644605
channel_id: self.channel_id,
@@ -648,9 +609,9 @@ impl Message {
648609
guild_id: self.guild_id,
649610
member: self.member.as_deref().map(|member| member.clone().into()),
650611
message_author_id: None,
651-
burst,
612+
burst: false,
652613
burst_colours: None,
653-
reaction_type: reaction_types,
614+
reaction_type: ReactionTypes::Normal,
654615
})
655616
}
656617

0 commit comments

Comments
 (0)