add send_message to user

This commit is contained in:
bitfl0wer 2023-05-03 17:29:20 +02:00
parent 5e399dba26
commit 98bf70ec5e
No known key found for this signature in database
GPG Key ID: 84BBB60DF895ABF2
1 changed files with 15 additions and 1 deletions

View File

@ -48,5 +48,19 @@ pub mod messages {
} }
} }
impl<'a> User<'a> {} impl<'a> User<'a> {
pub async fn send_message(
&mut self,
message: &Message,
) -> Result<Response, InstanceServerError> {
Message::send(
&self.belongs_to().urls.get_api().to_string(),
message,
self.rate_limits.get_as_mut(),
&mut self.belongs_to.limits.get_as_mut(),
&mut LimitedRequester::new().await,
)
.await
}
}
} }