From 47d1c52014d7eb9b76cb04aa6ec3359dd13b89a9 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Sun, 4 Jun 2023 14:20:06 +0200 Subject: [PATCH] Change file structure --- src/api/channels/reactions.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/api/channels/reactions.rs b/src/api/channels/reactions.rs index 0fc265b..0dd2a57 100644 --- a/src/api/channels/reactions.rs +++ b/src/api/channels/reactions.rs @@ -7,12 +7,11 @@ use crate::{ }; /** -Extends the [`types::Reaction`] struct with useful metadata. +Useful metadata for working with [`types::Reaction`], bundled together nicely. */ pub struct ReactionMeta { pub message_id: types::Snowflake, pub channel_id: types::Snowflake, - pub reaction: types::Reaction, } impl ReactionMeta { @@ -131,9 +130,7 @@ impl ReactionMeta { ) .await } -} -impl types::Reaction { /** Create a reaction for the message. @@ -156,8 +153,7 @@ impl types::Reaction { See [https://discord.com/developers/docs/resources/channel#create-reaction](https://discord.com/developers/docs/resources/channel#create-reaction) */ pub async fn create( - channel_id: &Snowflake, - message_id: &Snowflake, + &self, emoji: &str, user: &mut UserMeta, ) -> Result { @@ -165,8 +161,8 @@ impl types::Reaction { let url = format!( "{}/channels/{}/messages/{}/reactions/{}/@me/", belongs_to.urls.get_api(), - channel_id, - message_id, + self.channel_id, + self.message_id, emoji ); let request = Client::new().put(url).bearer_auth(user.token());