rive_http/channels/
channel_invites.rs

1use crate::prelude::*;
2use rive_models::channel::PartialInvite;
3
4impl Client {
5    /// Creates an invite to this channel.
6    ///
7    /// Channel must be a [`Channel::TextChannel`].
8    ///
9    /// [`Channel::TextChannel`]: rive_models::channel::Channel::TextChannel
10    pub async fn create_invite(&self, id: impl Into<String>) -> Result<PartialInvite> {
11        Ok(self
12            .client
13            .post(ep!(self, "/channels/{}/invites", id.into()))
14            .auth(&self.authentication)
15            .send()
16            .await?
17            .process_error()
18            .await?
19            .json()
20            .await?)
21    }
22}