pub struct Client { /* private fields */ }
Implementations§
source§impl Client
impl Client
sourcepub async fn create_account(&self, data: CreateAccountData) -> Result<(), Error>
pub async fn create_account(&self, data: CreateAccountData) -> Result<(), Error>
Create a new account.
sourcepub async fn resend_verification(
&self,
data: ResendVerificationData
) -> Result<(), Error>
pub async fn resend_verification( &self, data: ResendVerificationData ) -> Result<(), Error>
Resend account creation verification email.
sourcepub async fn confirm_account_deletion(
&self,
data: ConfirmAccountDeletionData
) -> Result<(), Error>
pub async fn confirm_account_deletion( &self, data: ConfirmAccountDeletionData ) -> Result<(), Error>
Schedule an account for deletion by confirming the received token.
sourcepub async fn delete_account(&self) -> Result<(), Error>
pub async fn delete_account(&self) -> Result<(), Error>
Request to have an account deleted.
sourcepub async fn fetch_account(&self) -> Result<AccountInfo, Error>
pub async fn fetch_account(&self) -> Result<AccountInfo, Error>
Fetch account information from the current session.
sourcepub async fn disable_account(&self) -> Result<(), Error>
pub async fn disable_account(&self) -> Result<(), Error>
Disable an account.
sourcepub async fn change_password(
&self,
data: ChangePasswordData
) -> Result<(), Error>
pub async fn change_password( &self, data: ChangePasswordData ) -> Result<(), Error>
Change the current account password.
sourcepub async fn change_email(&self, data: ChangeEmailData) -> Result<(), Error>
pub async fn change_email(&self, data: ChangeEmailData) -> Result<(), Error>
Change the associated account email.
sourcepub async fn verify_email(
&self,
code: impl Into<String>
) -> Result<EmailVerification, Error>
pub async fn verify_email( &self, code: impl Into<String> ) -> Result<EmailVerification, Error>
Change the associated account email.
sourcepub async fn send_password_reset(
&self,
data: SendPasswordResetData
) -> Result<(), Error>
pub async fn send_password_reset( &self, data: SendPasswordResetData ) -> Result<(), Error>
Send an email to reset account password.
sourcepub async fn password_reset(&self, data: PasswordResetData) -> Result<(), Error>
pub async fn password_reset(&self, data: PasswordResetData) -> Result<(), Error>
Confirm password reset and change the password.
source§impl Client
impl Client
sourcepub async fn create_mfa_ticket(
&self,
data: CreateMFATicketData
) -> Result<MFATicket, Error>
pub async fn create_mfa_ticket( &self, data: CreateMFATicketData ) -> Result<MFATicket, Error>
Create a new MFA ticket or validate an existing one.
sourcepub async fn fetch_mfa_status(&self) -> Result<MFAStatus, Error>
pub async fn fetch_mfa_status(&self) -> Result<MFAStatus, Error>
Fetch MFA status of an account.
sourcepub async fn fetch_recovery_codes(&self) -> Result<Vec<MFARecoveryCode>, Error>
pub async fn fetch_recovery_codes(&self) -> Result<Vec<MFARecoveryCode>, Error>
Fetch recovery codes for an account.
sourcepub async fn generate_recovery_codes(
&self
) -> Result<Vec<MFARecoveryCode>, Error>
pub async fn generate_recovery_codes( &self ) -> Result<Vec<MFARecoveryCode>, Error>
Re-generate recovery codes for an account.
sourcepub async fn get_mfa_methods(&self) -> Result<Vec<MFAMethod>, Error>
pub async fn get_mfa_methods(&self) -> Result<Vec<MFAMethod>, Error>
Fetch available MFA methods.
sourcepub async fn enable_totp_2fa(
&self,
data: EnableTOTP2FAData
) -> Result<(), Error>
pub async fn enable_totp_2fa( &self, data: EnableTOTP2FAData ) -> Result<(), Error>
Enable TOTP 2FA for an account.
sourcepub async fn generate_totp_secret(&self) -> Result<TOTPSecret, Error>
pub async fn generate_totp_secret(&self) -> Result<TOTPSecret, Error>
Generate a new secret for TOTP.
sourcepub async fn disable_totp_2fa(&self) -> Result<(), Error>
pub async fn disable_totp_2fa(&self) -> Result<(), Error>
Disable TOTP 2FA for an account.
source§impl Client
impl Client
sourcepub async fn check_onboarding_status(&self) -> Result<OnboardingStatus, Error>
pub async fn check_onboarding_status(&self) -> Result<OnboardingStatus, Error>
This will tell you whether the current account requires onboarding or whether you can continue to send requests as usual. You may skip calling this if you’re restoring an existing session.
sourcepub async fn complete_onboarding(
&self,
data: CompleteOnboardingData
) -> Result<(), Error>
pub async fn complete_onboarding( &self, data: CompleteOnboardingData ) -> Result<(), Error>
This sets a new username, completes onboarding and allows a user to start using Revolt.
source§impl Client
impl Client
sourcepub async fn login(&self, data: LoginData) -> Result<LoginResponse, Error>
pub async fn login(&self, data: LoginData) -> Result<LoginResponse, Error>
Login to an account.
sourcepub async fn fetch_sessions(&self) -> Result<Vec<SessionInfo>, Error>
pub async fn fetch_sessions(&self) -> Result<Vec<SessionInfo>, Error>
Fetch all sessions associated with this account.
sourcepub async fn delete_all_sessions(
&self,
data: DeleteAllSessionsData
) -> Result<(), Error>
pub async fn delete_all_sessions( &self, data: DeleteAllSessionsData ) -> Result<(), Error>
Delete all active sessions, optionally including current one.
sourcepub async fn revoke_session(&self, id: impl Into<String>) -> Result<(), Error>
pub async fn revoke_session(&self, id: impl Into<String>) -> Result<(), Error>
Delete a specific active session.
sourcepub async fn edit_session(
&self,
id: impl Into<String>,
data: EditSessionData
) -> Result<SessionInfo, Error>
pub async fn edit_session( &self, id: impl Into<String>, data: EditSessionData ) -> Result<SessionInfo, Error>
Edit specific session information.
source§impl Client
impl Client
sourcepub async fn create_bot(&self, data: CreateBotData) -> Result<Bot, Error>
pub async fn create_bot(&self, data: CreateBotData) -> Result<Bot, Error>
Create a new Revolt bot.
sourcepub async fn fetch_public_bot(
&self,
id: impl Into<String>
) -> Result<PublicBot, Error>
pub async fn fetch_public_bot( &self, id: impl Into<String> ) -> Result<PublicBot, Error>
Fetch details of a public (or owned) bot by its id.
sourcepub async fn invite_bot(
&self,
bot_id: impl Into<String>,
data: InviteBotData
) -> Result<(), Error>
pub async fn invite_bot( &self, bot_id: impl Into<String>, data: InviteBotData ) -> Result<(), Error>
Invite a bot to a server or group by its id.
sourcepub async fn fetch_bot(&self, id: impl Into<String>) -> Result<OwnedBot, Error>
pub async fn fetch_bot(&self, id: impl Into<String>) -> Result<OwnedBot, Error>
Fetch details of a bot you own by its id.
sourcepub async fn delete_bot(&self, id: impl Into<String>) -> Result<(), Error>
pub async fn delete_bot(&self, id: impl Into<String>) -> Result<(), Error>
Delete a bot by its id.
sourcepub async fn edit_bot(
&self,
id: impl Into<String>,
data: EditBotData
) -> Result<Bot, Error>
pub async fn edit_bot( &self, id: impl Into<String>, data: EditBotData ) -> Result<Bot, Error>
Edit bot details by its id.
sourcepub async fn fetch_owned_bots(&self) -> Result<OwnedBots, Error>
pub async fn fetch_owned_bots(&self) -> Result<OwnedBots, Error>
Fetch all of the bots that you have control over.
source§impl Client
impl Client
sourcepub async fn fetch_channel(
&self,
id: impl Into<String>
) -> Result<Channel, Error>
pub async fn fetch_channel( &self, id: impl Into<String> ) -> Result<Channel, Error>
Fetch channel by its ID.
sourcepub async fn close_channel(&self, id: impl Into<String>) -> Result<(), Error>
pub async fn close_channel(&self, id: impl Into<String>) -> Result<(), Error>
Deletes a server channel, leaves a group or closes a group.
sourcepub async fn edit_channel(
&self,
id: impl Into<String>,
data: EditChannelData
) -> Result<Channel, Error>
pub async fn edit_channel( &self, id: impl Into<String>, data: EditChannelData ) -> Result<Channel, Error>
Edit a channel object by its id.
source§impl Client
impl Client
sourcepub async fn create_invite(
&self,
id: impl Into<String>
) -> Result<PartialInvite, Error>
pub async fn create_invite( &self, id: impl Into<String> ) -> Result<PartialInvite, Error>
Creates an invite to this channel.
Channel must be a Channel::TextChannel
.
source§impl Client
impl Client
sourcepub async fn set_role_channel_permissions(
&self,
channel_id: impl Into<String>,
role_id: impl Into<String>,
data: SetRolePermissionData
) -> Result<Channel, Error>
pub async fn set_role_channel_permissions( &self, channel_id: impl Into<String>, role_id: impl Into<String>, data: SetRolePermissionData ) -> Result<Channel, Error>
Sets permissions for the specified role in this channel.
Channel must be a Channel::TextChannel or Channel::VoiceChannel.
sourcepub async fn set_default_channel_permissions(
&self,
channel_id: impl Into<String>,
data: SetDefaultPermissionData
) -> Result<Channel, Error>
pub async fn set_default_channel_permissions( &self, channel_id: impl Into<String>, data: SetDefaultPermissionData ) -> Result<Channel, Error>
Sets permissions for the specified role in this channel.
Channel must be a Channel::Group, Channel::TextChannel or Channel::VoiceChannel.
source§impl Client
impl Client
sourcepub async fn fetch_group_members(
&self,
id: impl Into<String>
) -> Result<Vec<User>, Error>
pub async fn fetch_group_members( &self, id: impl Into<String> ) -> Result<Vec<User>, Error>
Retrieves all users who are part of this group.
sourcepub async fn create_group(
&self,
data: CreateGroupData
) -> Result<Channel, Error>
pub async fn create_group( &self, data: CreateGroupData ) -> Result<Channel, Error>
Create a new group channel.
source§impl Client
impl Client
sourcepub async fn add_reaction_to_message(
&self,
channel_id: impl Into<String>,
message_id: impl Into<String>,
emoji: impl Into<String>
) -> Result<(), Error>
pub async fn add_reaction_to_message( &self, channel_id: impl Into<String>, message_id: impl Into<String>, emoji: impl Into<String> ) -> Result<(), Error>
React to a given message.
sourcepub async fn remove_reaction_to_message(
&self,
channel_id: impl Into<String>,
message_id: impl Into<String>,
emoji: impl Into<String>,
data: RemoveReactionToMessageData
) -> Result<(), Error>
pub async fn remove_reaction_to_message( &self, channel_id: impl Into<String>, message_id: impl Into<String>, emoji: impl Into<String>, data: RemoveReactionToMessageData ) -> Result<(), Error>
Remove your own, someone else’s or all of a given reaction.
Requires Permission::ManageMessages
if changing others’ reactions.
sourcepub async fn remove_all_reactions_from_message(
&self,
channel_id: impl Into<String>,
message_id: impl Into<String>
) -> Result<(), Error>
pub async fn remove_all_reactions_from_message( &self, channel_id: impl Into<String>, message_id: impl Into<String> ) -> Result<(), Error>
Remove your own, someone else’s or all of a given reaction.
Requires Permission::ManageMessages
.
source§impl Client
impl Client
sourcepub async fn acknowledge_message(
&self,
channel_id: impl Into<String>,
message_id: impl Into<String>
) -> Result<(), Error>
pub async fn acknowledge_message( &self, channel_id: impl Into<String>, message_id: impl Into<String> ) -> Result<(), Error>
Lets the server and all other clients know that we’ve seen this message id in this channel.
sourcepub async fn fetch_messages(
&self,
channel_id: impl Into<String>,
data: FetchMessagesData
) -> Result<BulkMessageResponse, Error>
pub async fn fetch_messages( &self, channel_id: impl Into<String>, data: FetchMessagesData ) -> Result<BulkMessageResponse, Error>
Fetch multiple messages.
sourcepub async fn send_message(
&self,
channel_id: impl Into<String>,
data: SendMessageData
) -> Result<Message, Error>
pub async fn send_message( &self, channel_id: impl Into<String>, data: SendMessageData ) -> Result<Message, Error>
Send a message to a given channel.
sourcepub async fn search_for_messages(
&self,
channel_id: impl Into<String>,
data: SearchForMessagesData
) -> Result<Message, Error>
pub async fn search_for_messages( &self, channel_id: impl Into<String>, data: SearchForMessagesData ) -> Result<Message, Error>
Search for messages within the given parameters.
sourcepub async fn fetch_message(
&self,
channel_id: impl Into<String>,
message_id: impl Into<String>
) -> Result<Message, Error>
pub async fn fetch_message( &self, channel_id: impl Into<String>, message_id: impl Into<String> ) -> Result<Message, Error>
Retrieves a message by its ID.
sourcepub async fn delete_message(
&self,
channel_id: impl Into<String>,
message_id: impl Into<String>
) -> Result<(), Error>
pub async fn delete_message( &self, channel_id: impl Into<String>, message_id: impl Into<String> ) -> Result<(), Error>
Delete a message you’ve sent or one you have permission to delete.
pub async fn edit_message( &self, channel_id: impl Into<String>, message_id: impl Into<String>, data: EditMessageData ) -> Result<Message, Error>
sourcepub async fn bulk_delete_messages(
&self,
channel_id: impl Into<String>,
data: BulkDeleteMessagesData
) -> Result<(), Error>
pub async fn bulk_delete_messages( &self, channel_id: impl Into<String>, data: BulkDeleteMessagesData ) -> Result<(), Error>
Delete multiple messages you’ve sent or one you have permission to delete.
This will always require ManageMessages permission regardless of whether you own the message or not.
Messages must have been sent within the past 1 week.
source§impl Client
impl Client
sourcepub async fn create_webhook(
&self,
channel_id: impl Into<String>,
data: CreateWebhookData
) -> Result<Webhook, Error>
pub async fn create_webhook( &self, channel_id: impl Into<String>, data: CreateWebhookData ) -> Result<Webhook, Error>
Create a webhook which 3rd party platforms can use to send messages.
source§impl Client
impl Client
sourcepub async fn fetch_emoji(&self, id: impl Into<String>) -> Result<Emoji, Error>
pub async fn fetch_emoji(&self, id: impl Into<String>) -> Result<Emoji, Error>
Fetch an emoji by its ID.
sourcepub async fn create_new_emoji(
&self,
id: impl Into<String>,
data: CreateEmojiData
) -> Result<Emoji, Error>
pub async fn create_new_emoji( &self, id: impl Into<String>, data: CreateEmojiData ) -> Result<Emoji, Error>
Create an emoji by its Autumn upload id.
source§impl Client
impl Client
sourcepub async fn fetch_invite(&self, id: impl Into<String>) -> Result<Invite, Error>
pub async fn fetch_invite(&self, id: impl Into<String>) -> Result<Invite, Error>
Fetch an invite by its ID.
sourcepub async fn join_invite(
&self,
id: impl Into<String>
) -> Result<InviteJoin, Error>
pub async fn join_invite( &self, id: impl Into<String> ) -> Result<InviteJoin, Error>
Join an invite by its ID.
source§impl Client
impl Client
sourcepub async fn fetch_settings(
&self,
data: FetchMessagesData
) -> Result<UserSettings, Error>
pub async fn fetch_settings( &self, data: FetchMessagesData ) -> Result<UserSettings, Error>
Fetch settings from server filtered by keys.
sourcepub async fn set_settings(
&self,
data: HashMap<String, String>
) -> Result<(), Error>
pub async fn set_settings( &self, data: HashMap<String, String> ) -> Result<(), Error>
Upload data to save to settings.
sourcepub async fn fetch_unreads(&self) -> Result<Vec<ChannelUnread>, Error>
pub async fn fetch_unreads(&self) -> Result<Vec<ChannelUnread>, Error>
Fetch information about unread state on channels.
source§impl Client
impl Client
sourcepub async fn push_subscribe(&self, data: PushSubscribeData) -> Result<(), Error>
pub async fn push_subscribe(&self, data: PushSubscribeData) -> Result<(), Error>
Create a new Web Push subscription.
If an existing subscription exists on this session, it will be removed.
sourcepub async fn push_unsubscribe(&self) -> Result<(), Error>
pub async fn push_unsubscribe(&self) -> Result<(), Error>
Remove the Web Push subscription associated with the current session.
source§impl Client
impl Client
sourcepub async fn query_stats(&self) -> Result<Stats, Error>
pub async fn query_stats(&self) -> Result<Stats, Error>
Fetch various technical statistics.
sourcepub async fn globally_fetch_messages(
&self,
data: FetchMessagesData
) -> Result<BulkMessageResponse, Error>
pub async fn globally_fetch_messages( &self, data: FetchMessagesData ) -> Result<BulkMessageResponse, Error>
This is a privileged route to globally fetch messages.
source§impl Client
impl Client
sourcepub async fn edit_report(
&self,
report: impl Into<String>,
data: EditReportData
) -> Result<Report, Error>
pub async fn edit_report( &self, report: impl Into<String>, data: EditReportData ) -> Result<Report, Error>
Edit a report.
sourcepub async fn fetch_report(&self, id: impl Into<String>) -> Result<Report, Error>
pub async fn fetch_report(&self, id: impl Into<String>) -> Result<Report, Error>
Fetch a report by its ID.
sourcepub async fn report_content(&self, data: ReportContentData) -> Result<(), Error>
pub async fn report_content(&self, data: ReportContentData) -> Result<(), Error>
Report a piece of content to the moderation team.
sourcepub async fn fetch_snapshot(
&self,
report_id: impl Into<String>
) -> Result<Snapshot, Error>
pub async fn fetch_snapshot( &self, report_id: impl Into<String> ) -> Result<Snapshot, Error>
Fetch a snapshot for a given report.
sourcepub async fn create_strike(
&self,
data: CreateStrikeData
) -> Result<AccountStrike, Error>
pub async fn create_strike( &self, data: CreateStrikeData ) -> Result<AccountStrike, Error>
Create a new account strike.
sourcepub async fn fetch_strikes(
&self,
user_id: impl Into<String>
) -> Result<AccountStrike, Error>
pub async fn fetch_strikes( &self, user_id: impl Into<String> ) -> Result<AccountStrike, Error>
Fetch strikes for a user by their ID.
sourcepub async fn edit_strike(
&self,
strike_id: impl Into<String>,
data: EditAccountStrikeData
) -> Result<(), Error>
pub async fn edit_strike( &self, strike_id: impl Into<String>, data: EditAccountStrikeData ) -> Result<(), Error>
Edit a strike by its ID.
source§impl Client
impl Client
pub async fn query_node(&self) -> Result<InstanceConfiguration, Error>
source§impl Client
impl Client
sourcepub async fn create_server(
&self,
data: CreateServerData
) -> Result<Server, Error>
pub async fn create_server( &self, data: CreateServerData ) -> Result<Server, Error>
Create a new server.
sourcepub async fn fetch_server(&self, id: impl Into<String>) -> Result<Server, Error>
pub async fn fetch_server(&self, id: impl Into<String>) -> Result<Server, Error>
Deletes a server if owner otherwise leaves.
sourcepub async fn delete_or_leave_server(
&self,
id: impl Into<String>
) -> Result<(), Error>
pub async fn delete_or_leave_server( &self, id: impl Into<String> ) -> Result<(), Error>
Deletes a server if owner otherwise leaves.
sourcepub async fn edit_server(
&self,
id: impl Into<String>,
data: EditServerData
) -> Result<Server, Error>
pub async fn edit_server( &self, id: impl Into<String>, data: EditServerData ) -> Result<Server, Error>
Edit a server by its id.
sourcepub async fn mark_server_as_read(
&self,
id: impl Into<String>
) -> Result<(), Error>
pub async fn mark_server_as_read( &self, id: impl Into<String> ) -> Result<(), Error>
Mark all channels in a server as read.
sourcepub async fn create_channel(
&self,
server_id: impl Into<String>,
data: CreateChannelData
) -> Result<Channel, Error>
pub async fn create_channel( &self, server_id: impl Into<String>, data: CreateChannelData ) -> Result<Channel, Error>
Create a new Text or Voice channel
source§impl Client
impl Client
sourcepub async fn fetch_members(
&self,
server_id: impl Into<String>,
data: FetchMembersData
) -> Result<MemberList, Error>
pub async fn fetch_members( &self, server_id: impl Into<String>, data: FetchMembersData ) -> Result<MemberList, Error>
Fetch all server members.
sourcepub async fn fetch_member(
&self,
server_id: impl Into<String>,
member_id: impl Into<String>
) -> Result<Member, Error>
pub async fn fetch_member( &self, server_id: impl Into<String>, member_id: impl Into<String> ) -> Result<Member, Error>
Retreive a member.
sourcepub async fn kick_member(
&self,
server_id: impl Into<String>,
member_id: impl Into<String>
) -> Result<(), Error>
pub async fn kick_member( &self, server_id: impl Into<String>, member_id: impl Into<String> ) -> Result<(), Error>
Remove a member from the server.
sourcepub async fn edit_member(
&self,
server_id: impl Into<String>,
member_id: impl Into<String>,
data: EditMemberData
) -> Result<Member, Error>
pub async fn edit_member( &self, server_id: impl Into<String>, member_id: impl Into<String>, data: EditMemberData ) -> Result<Member, Error>
Edit a member by their ID.
sourcepub async fn ban_user(
&self,
server_id: impl Into<String>,
user_id: impl Into<String>,
data: BanUserData
) -> Result<ServerBan, Error>
pub async fn ban_user( &self, server_id: impl Into<String>, user_id: impl Into<String>, data: BanUserData ) -> Result<ServerBan, Error>
Ban a user by their ID.
sourcepub async fn unban_user(
&self,
server_id: impl Into<String>,
user_id: impl Into<String>
) -> Result<(), Error>
pub async fn unban_user( &self, server_id: impl Into<String>, user_id: impl Into<String> ) -> Result<(), Error>
Remove a user’s ban.
sourcepub async fn fetch_bans(
&self,
server_id: impl Into<String>
) -> Result<BanList, Error>
pub async fn fetch_bans( &self, server_id: impl Into<String> ) -> Result<BanList, Error>
Fetch all bans on a server.
sourcepub async fn fetch_invites(
&self,
server_id: impl Into<String>
) -> Result<PartialInvite, Error>
pub async fn fetch_invites( &self, server_id: impl Into<String> ) -> Result<PartialInvite, Error>
Fetch all server invites.
source§impl Client
impl Client
sourcepub async fn create_role(
&self,
server_id: impl Into<String>,
data: CreateRoleData
) -> Result<NewRole, Error>
pub async fn create_role( &self, server_id: impl Into<String>, data: CreateRoleData ) -> Result<NewRole, Error>
Creates a new server role.
sourcepub async fn delete_role(
&self,
server_id: impl Into<String>,
role_id: impl Into<String>
) -> Result<(), Error>
pub async fn delete_role( &self, server_id: impl Into<String>, role_id: impl Into<String> ) -> Result<(), Error>
Delete a server role by its ID.
sourcepub async fn edit_role(
&self,
server_id: impl Into<String>,
role_id: impl Into<String>,
data: EditRoleData
) -> Result<Role, Error>
pub async fn edit_role( &self, server_id: impl Into<String>, role_id: impl Into<String>, data: EditRoleData ) -> Result<Role, Error>
Edit a role by its ID.
sourcepub async fn set_role_permission(
&self,
server_id: impl Into<String>,
role_id: impl Into<String>,
data: SetServerRolePermissionData
) -> Result<Server, Error>
pub async fn set_role_permission( &self, server_id: impl Into<String>, role_id: impl Into<String>, data: SetServerRolePermissionData ) -> Result<Server, Error>
Sets permissions for the specified role in the server.
sourcepub async fn set_default_permission(
&self,
server_id: impl Into<String>,
data: SetDefaultRolePermissionData
) -> Result<Server, Error>
pub async fn set_default_permission( &self, server_id: impl Into<String>, data: SetDefaultRolePermissionData ) -> Result<Server, Error>
Sets permissions for the default role in the server.
source§impl Client
impl Client
source§impl Client
impl Client
sourcepub async fn fetch_mutual_friends_and_servers(
&self,
id: impl Into<String>
) -> Result<Mutuals, Error>
pub async fn fetch_mutual_friends_and_servers( &self, id: impl Into<String> ) -> Result<Mutuals, Error>
This fetches your direct messages, including any DM and group DM conversations.
sourcepub async fn accept_friend_request(
&self,
id: impl Into<String>
) -> Result<User, Error>
pub async fn accept_friend_request( &self, id: impl Into<String> ) -> Result<User, Error>
Accept another user’s friend request
sourcepub async fn remove_or_deny_friend(
&self,
id: impl Into<String>
) -> Result<User, Error>
pub async fn remove_or_deny_friend( &self, id: impl Into<String> ) -> Result<User, Error>
Denies another user’s friend request or removes an existing friend.
sourcepub async fn block_user(&self, id: impl Into<String>) -> Result<User, Error>
pub async fn block_user(&self, id: impl Into<String>) -> Result<User, Error>
Block another user by their id.
sourcepub async fn unblock_user(&self, id: impl Into<String>) -> Result<User, Error>
pub async fn unblock_user(&self, id: impl Into<String>) -> Result<User, Error>
Unblock another user by their id.
sourcepub async fn send_friend_request(
&self,
data: SendFriendRequestData
) -> Result<User, Error>
pub async fn send_friend_request( &self, data: SendFriendRequestData ) -> Result<User, Error>
Send a friend request to another user.
source§impl Client
impl Client
sourcepub async fn fetch_self(&self) -> Result<User, Error>
pub async fn fetch_self(&self) -> Result<User, Error>
Retrieve your user information.
sourcepub async fn edit_user(&self, data: EditUserData) -> Result<User, Error>
pub async fn edit_user(&self, data: EditUserData) -> Result<User, Error>
Edit currently authenticated user.
sourcepub async fn fetch_user(&self, id: impl Into<String>) -> Result<User, Error>
pub async fn fetch_user(&self, id: impl Into<String>) -> Result<User, Error>
Fetch a user’s information.
sourcepub async fn change_username(
&self,
data: ChangeUsernameData
) -> Result<User, Error>
pub async fn change_username( &self, data: ChangeUsernameData ) -> Result<User, Error>
Change your username.
sourcepub async fn fetch_default_avatar(
&self,
id: impl Into<String>
) -> Result<Vec<u8>, Error>
pub async fn fetch_default_avatar( &self, id: impl Into<String> ) -> Result<Vec<u8>, Error>
This returns a default avatar based on the given id.
sourcepub async fn fetch_user_profile(
&self,
id: impl Into<String>
) -> Result<UserProfile, Error>
pub async fn fetch_user_profile( &self, id: impl Into<String> ) -> Result<UserProfile, Error>
Retrieve a user’s profile data.
Will fail if you do not have permission to access the other user’s profile.
source§impl Client
impl Client
sourcepub fn new(authentication: Authentication) -> Self
pub fn new(authentication: Authentication) -> Self
Create a client instance with the API base URL of Revolt official instance.
sourcepub fn new_base_url(
authentication: Authentication,
base_url: impl Into<String>
) -> Self
pub fn new_base_url( authentication: Authentication, base_url: impl Into<String> ) -> Self
Create a client instance with given base URL.