pub struct Client { /* private fields */ }Implementations§
source§impl Client
impl Client
sourcepub async fn create_account(
&self,
payload: CreateAccountPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn create_account( &self, payload: CreateAccountPayload ) -> impl Future<Output = Result<(), Error>>
Create a new account.
sourcepub async fn resend_verification(
&self,
payload: ResendVerificationPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn resend_verification( &self, payload: ResendVerificationPayload ) -> impl Future<Output = Result<(), Error>>
Resend account creation verification email.
sourcepub async fn confirm_account_deletion(
&self,
payload: ConfirmAccountDeletionPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn confirm_account_deletion( &self, payload: ConfirmAccountDeletionPayload ) -> impl Future<Output = Result<(), Error>>
Schedule an account for deletion by confirming the received token.
sourcepub async fn delete_account(&self) -> impl Future<Output = Result<(), Error>>
pub async fn delete_account(&self) -> impl Future<Output = Result<(), Error>>
Request to have an account deleted.
sourcepub async fn fetch_account(
&self
) -> impl Future<Output = Result<AccountInfo, Error>>
pub async fn fetch_account( &self ) -> impl Future<Output = Result<AccountInfo, Error>>
Fetch account information from the current session.
sourcepub async fn disable_account(&self) -> impl Future<Output = Result<(), Error>>
pub async fn disable_account(&self) -> impl Future<Output = Result<(), Error>>
Disable an account.
sourcepub async fn change_password(
&self,
payload: ChangePasswordPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn change_password( &self, payload: ChangePasswordPayload ) -> impl Future<Output = Result<(), Error>>
Change the current account password.
sourcepub async fn change_email(
&self,
payload: ChangeEmailPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn change_email( &self, payload: ChangeEmailPayload ) -> impl Future<Output = Result<(), Error>>
Change the associated account email.
sourcepub async fn verify_email(
&self,
code: impl Into<String>
) -> impl Future<Output = Result<EmailVerification, Error>>
pub async fn verify_email( &self, code: impl Into<String> ) -> impl Future<Output = Result<EmailVerification, Error>>
Change the associated account email.
sourcepub async fn send_password_reset(
&self,
payload: SendPasswordResetPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn send_password_reset( &self, payload: SendPasswordResetPayload ) -> impl Future<Output = Result<(), Error>>
Send an email to reset account password.
sourcepub async fn password_reset(
&self,
payload: PasswordResetPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn password_reset( &self, payload: PasswordResetPayload ) -> impl Future<Output = Result<(), Error>>
Confirm password reset and change the password.
source§impl Client
impl Client
sourcepub async fn create_mfa_ticket(
&self,
payload: MFAData
) -> impl Future<Output = Result<MFATicket, Error>>
pub async fn create_mfa_ticket( &self, payload: MFAData ) -> impl Future<Output = Result<MFATicket, Error>>
Create a new MFA ticket or validate an existing one.
sourcepub async fn fetch_mfa_status(
&self
) -> impl Future<Output = Result<MFAStatus, Error>>
pub async fn fetch_mfa_status( &self ) -> impl Future<Output = Result<MFAStatus, Error>>
Fetch MFA status of an account.
sourcepub async fn fetch_recovery_codes(
&self
) -> impl Future<Output = Result<Vec<String, Global>, Error>>
pub async fn fetch_recovery_codes( &self ) -> impl Future<Output = Result<Vec<String, Global>, Error>>
Fetch recovery codes for an account.
sourcepub async fn generate_recovery_codes(
&self
) -> impl Future<Output = Result<Vec<String, Global>, Error>>
pub async fn generate_recovery_codes( &self ) -> impl Future<Output = Result<Vec<String, Global>, Error>>
Re-generate recovery codes for an account.
sourcepub async fn get_mfa_methods(
&self
) -> impl Future<Output = Result<Vec<MFAMethod, Global>, Error>>
pub async fn get_mfa_methods( &self ) -> impl Future<Output = Result<Vec<MFAMethod, Global>, Error>>
Fetch available MFA methods.
sourcepub async fn enable_totp_2fa(
&self,
payload: MFAData
) -> impl Future<Output = Result<(), Error>>
pub async fn enable_totp_2fa( &self, payload: MFAData ) -> impl Future<Output = Result<(), Error>>
Enable TOTP 2FA for an account.
sourcepub async fn generate_totp_secret(
&self
) -> impl Future<Output = Result<TOTPSecret, Error>>
pub async fn generate_totp_secret( &self ) -> impl Future<Output = Result<TOTPSecret, Error>>
Generate a new secret for TOTP.
source§impl Client
impl Client
sourcepub async fn check_onboarding_status(
&self
) -> impl Future<Output = Result<OnboardingStatus, Error>>
pub async fn check_onboarding_status( &self ) -> impl Future<Output = 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,
payload: CompleteOnboardingPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn complete_onboarding( &self, payload: CompleteOnboardingPayload ) -> impl Future<Output = 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,
payload: LoginPayload
) -> impl Future<Output = Result<LoginResponse, Error>>
pub async fn login( &self, payload: LoginPayload ) -> impl Future<Output = Result<LoginResponse, Error>>
Login to an account.
sourcepub async fn fetch_sessions(
&self
) -> impl Future<Output = Result<Vec<SessionInfo, Global>, Error>>
pub async fn fetch_sessions( &self ) -> impl Future<Output = Result<Vec<SessionInfo, Global>, Error>>
Fetch all sessions associated with this account.
sourcepub async fn delete_all_sessions(
&self,
payload: DeleteAllSessionsPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn delete_all_sessions( &self, payload: DeleteAllSessionsPayload ) -> impl Future<Output = Result<(), Error>>
Delete all active sessions, optionally including current one.
sourcepub async fn revoke_session(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<(), Error>>
pub async fn revoke_session( &self, id: impl Into<String> ) -> impl Future<Output = Result<(), Error>>
Delete a specific active session.
sourcepub async fn edit_session(
&self,
id: impl Into<String>,
payload: EditSessionPayload
) -> impl Future<Output = Result<SessionInfo, Error>>
pub async fn edit_session( &self, id: impl Into<String>, payload: EditSessionPayload ) -> impl Future<Output = Result<SessionInfo, Error>>
Edit specific session information.
source§impl Client
impl Client
sourcepub async fn create_bot(
&self,
payload: CreateBotPayload
) -> impl Future<Output = Result<Bot, Error>>
pub async fn create_bot( &self, payload: CreateBotPayload ) -> impl Future<Output = Result<Bot, Error>>
Create a new Revolt bot.
sourcepub async fn fetch_public_bot(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<PublicBot, Error>>
pub async fn fetch_public_bot( &self, id: impl Into<String> ) -> impl Future<Output = 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>,
payload: InviteBotPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn invite_bot( &self, bot_id: impl Into<String>, payload: InviteBotPayload ) -> impl Future<Output = Result<(), Error>>
Invite a bot to a server or group by its id.
sourcepub async fn fetch_bot(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<OwnedBot, Error>>
pub async fn fetch_bot( &self, id: impl Into<String> ) -> impl Future<Output = Result<OwnedBot, Error>>
Fetch details of a bot you own by its id.
sourcepub async fn delete_bot(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<(), Error>>
pub async fn delete_bot( &self, id: impl Into<String> ) -> impl Future<Output = Result<(), Error>>
Delete a bot by its id.
source§impl Client
impl Client
sourcepub async fn fetch_channel(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<Channel, Error>>
pub async fn fetch_channel( &self, id: impl Into<String> ) -> impl Future<Output = Result<Channel, Error>>
Fetch channel by its ID.
sourcepub async fn close_channel(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<(), Error>>
pub async fn close_channel( &self, id: impl Into<String> ) -> impl Future<Output = Result<(), Error>>
Deletes a server channel, leaves a group or closes a group.
sourcepub async fn edit_channel(
&self,
id: impl Into<String>,
payload: EditChannelPayload
) -> impl Future<Output = Result<Channel, Error>>
pub async fn edit_channel( &self, id: impl Into<String>, payload: EditChannelPayload ) -> impl Future<Output = 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>
) -> impl Future<Output = Result<PartialInvite, Error>>
pub async fn create_invite( &self, id: impl Into<String> ) -> impl Future<Output = 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>,
payload: SetRolePermissionPayload
) -> impl Future<Output = Result<Channel, Error>>
pub async fn set_role_channel_permissions( &self, channel_id: impl Into<String>, role_id: impl Into<String>, payload: SetRolePermissionPayload ) -> impl Future<Output = 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>,
payload: SetDefaultPermissionPayload
) -> impl Future<Output = Result<Channel, Error>>
pub async fn set_default_channel_permissions( &self, channel_id: impl Into<String>, payload: SetDefaultPermissionPayload ) -> impl Future<Output = 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>
) -> impl Future<Output = Result<Vec<User, Global>, Error>>
pub async fn fetch_group_members( &self, id: impl Into<String> ) -> impl Future<Output = Result<Vec<User, Global>, Error>>
Retrieves all users who are part of this group.
sourcepub async fn create_group(
&self,
payload: CreateGroupPayload
) -> impl Future<Output = Result<Channel, Error>>
pub async fn create_group( &self, payload: CreateGroupPayload ) -> impl Future<Output = 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>
) -> impl Future<Output = Result<(), Error>>
pub async fn add_reaction_to_message( &self, channel_id: impl Into<String>, message_id: impl Into<String>, emoji: impl Into<String> ) -> impl Future<Output = 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>,
payload: RemoveReactionToMessagePayload
) -> impl Future<Output = Result<(), Error>>
pub async fn remove_reaction_to_message( &self, channel_id: impl Into<String>, message_id: impl Into<String>, emoji: impl Into<String>, payload: RemoveReactionToMessagePayload ) -> impl Future<Output = Result<(), Error>>
Remove your own, someone else’s or all of a given reaction.
Requires [Permission::ManageMessages] if changing others’ reactions.
source§impl Client
impl Client
sourcepub async fn acknowledge_message(
&self,
channel_id: impl Into<String>,
message_id: impl Into<String>
) -> impl Future<Output = Result<(), Error>>
pub async fn acknowledge_message( &self, channel_id: impl Into<String>, message_id: impl Into<String> ) -> impl Future<Output = 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>,
payload: FetchMessagesPayload
) -> impl Future<Output = Result<BulkMessageResponse, Error>>
pub async fn fetch_messages( &self, channel_id: impl Into<String>, payload: FetchMessagesPayload ) -> impl Future<Output = Result<BulkMessageResponse, Error>>
Fetch multiple messages.
sourcepub async fn send_message(
&self,
channel_id: impl Into<String>,
payload: SendMessagePayload
) -> impl Future<Output = Result<Message, Error>>
pub async fn send_message( &self, channel_id: impl Into<String>, payload: SendMessagePayload ) -> impl Future<Output = Result<Message, Error>>
Send a message to a given channel.
sourcepub async fn search_for_messages(
&self,
channel_id: impl Into<String>,
payload: SearchForMessagesPayload
) -> impl Future<Output = Result<Message, Error>>
pub async fn search_for_messages( &self, channel_id: impl Into<String>, payload: SearchForMessagesPayload ) -> impl Future<Output = 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>
) -> impl Future<Output = Result<Message, Error>>
pub async fn fetch_message( &self, channel_id: impl Into<String>, message_id: impl Into<String> ) -> impl Future<Output = 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>
) -> impl Future<Output = Result<(), Error>>
pub async fn delete_message( &self, channel_id: impl Into<String>, message_id: impl Into<String> ) -> impl Future<Output = 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>, payload: EditMessagePayload ) -> impl Future<Output = Result<Message, Error>>
sourcepub async fn bulk_delete_messages(
&self,
channel_id: impl Into<String>,
payload: BulkDeleteMessagesPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn bulk_delete_messages( &self, channel_id: impl Into<String>, payload: BulkDeleteMessagesPayload ) -> impl Future<Output = 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 fetch_emoji(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<Emoji, Error>>
pub async fn fetch_emoji( &self, id: impl Into<String> ) -> impl Future<Output = Result<Emoji, Error>>
Fetch an emoji by its ID.
sourcepub async fn create_new_emoji(
&self,
id: impl Into<String>,
payload: CreateEmojiPayload
) -> impl Future<Output = Result<Emoji, Error>>
pub async fn create_new_emoji( &self, id: impl Into<String>, payload: CreateEmojiPayload ) -> impl Future<Output = Result<Emoji, Error>>
Create an emoji by its Autumn upload id.
source§impl Client
impl Client
source§impl Client
impl Client
sourcepub async fn fetch_settings(
&self,
payload: FetchMessagesPayload
) -> impl Future<Output = Result<HashMap<String, (i64, String), RandomState>, Error>>
pub async fn fetch_settings( &self, payload: FetchMessagesPayload ) -> impl Future<Output = Result<HashMap<String, (i64, String), RandomState>, Error>>
Fetch settings from server filtered by keys.
sourcepub async fn set_settings(
&self,
payload: HashMap<String, String, RandomState>
) -> impl Future<Output = Result<(), Error>>
pub async fn set_settings( &self, payload: HashMap<String, String, RandomState> ) -> impl Future<Output = Result<(), Error>>
Upload data to save to settings.
sourcepub async fn fetch_unreads(
&self
) -> impl Future<Output = Result<Vec<ChannelUnread, Global>, Error>>
pub async fn fetch_unreads( &self ) -> impl Future<Output = Result<Vec<ChannelUnread, Global>, Error>>
Fetch information about unread state on channels.
source§impl Client
impl Client
sourcepub async fn push_subscribe(
&self,
payload: PushSubscribePayload
) -> impl Future<Output = Result<(), Error>>
pub async fn push_subscribe( &self, payload: PushSubscribePayload ) -> impl Future<Output = Result<(), Error>>
Create a new Web Push subscription.
If an existing subscription exists on this session, it will be removed.
source§impl Client
impl Client
sourcepub async fn query_stats(&self) -> impl Future<Output = Result<Stats, Error>>
pub async fn query_stats(&self) -> impl Future<Output = Result<Stats, Error>>
Fetch various technical statistics.
sourcepub async fn globally_fetch_messages(
&self,
payload: FetchMessagesPayload
) -> impl Future<Output = Result<BulkMessageResponse, Error>>
pub async fn globally_fetch_messages( &self, payload: FetchMessagesPayload ) -> impl Future<Output = 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>,
payload: EditReportPayload
) -> impl Future<Output = Result<Report, Error>>
pub async fn edit_report( &self, report: impl Into<String>, payload: EditReportPayload ) -> impl Future<Output = Result<Report, Error>>
Edit a report.
sourcepub async fn fetch_report(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<Report, Error>>
pub async fn fetch_report( &self, id: impl Into<String> ) -> impl Future<Output = Result<Report, Error>>
Fetch a report by its ID.
sourcepub async fn fetch_reports(
&self
) -> impl Future<Output = Result<Vec<Report, Global>, Error>>
pub async fn fetch_reports( &self ) -> impl Future<Output = Result<Vec<Report, Global>, Error>>
Fetch all available reports
sourcepub async fn report_content(
&self,
payload: ReportContentPayload
) -> impl Future<Output = Result<(), Error>>
pub async fn report_content( &self, payload: ReportContentPayload ) -> impl Future<Output = Result<(), Error>>
Report a piece of content to the moderation team.
source§impl Client
impl Client
pub async fn query_node( &self ) -> impl Future<Output = Result<InstanceConfiguration, Error>>
source§impl Client
impl Client
sourcepub async fn create_server(
&self,
payload: CreateServerPayload
) -> impl Future<Output = Result<Server, Error>>
pub async fn create_server( &self, payload: CreateServerPayload ) -> impl Future<Output = Result<Server, Error>>
Create a new server.
sourcepub async fn fetch_server(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<Server, Error>>
pub async fn fetch_server( &self, id: impl Into<String> ) -> impl Future<Output = Result<Server, Error>>
Deletes a server if owner otherwise leaves.
sourcepub async fn delete_or_leave_server(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<(), Error>>
pub async fn delete_or_leave_server( &self, id: impl Into<String> ) -> impl Future<Output = Result<(), Error>>
Deletes a server if owner otherwise leaves.
sourcepub async fn edit_server(
&self,
id: impl Into<String>,
payload: EditServerPayload
) -> impl Future<Output = Result<Server, Error>>
pub async fn edit_server( &self, id: impl Into<String>, payload: EditServerPayload ) -> impl Future<Output = Result<Server, Error>>
Edit a server by its id.
sourcepub async fn mark_server_as_read(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<(), Error>>
pub async fn mark_server_as_read( &self, id: impl Into<String> ) -> impl Future<Output = Result<(), Error>>
Mark all channels in a server as read.
sourcepub async fn create_channel(
&self,
server_id: impl Into<String>,
payload: CreateChannelPayload
) -> impl Future<Output = Result<Channel, Error>>
pub async fn create_channel( &self, server_id: impl Into<String>, payload: CreateChannelPayload ) -> impl Future<Output = 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>,
payload: FetchMembersPayload
) -> impl Future<Output = Result<MemberList, Error>>
pub async fn fetch_members( &self, server_id: impl Into<String>, payload: FetchMembersPayload ) -> impl Future<Output = Result<MemberList, Error>>
Fetch all server members.
sourcepub async fn fetch_member(
&self,
server_id: impl Into<String>,
member_id: impl Into<String>
) -> impl Future<Output = Result<Member, Error>>
pub async fn fetch_member( &self, server_id: impl Into<String>, member_id: impl Into<String> ) -> impl Future<Output = Result<Member, Error>>
Retreive a member.
sourcepub async fn kick_member(
&self,
server_id: impl Into<String>,
member_id: impl Into<String>
) -> impl Future<Output = Result<(), Error>>
pub async fn kick_member( &self, server_id: impl Into<String>, member_id: impl Into<String> ) -> impl Future<Output = Result<(), Error>>
Remove a member from the server.
sourcepub async fn edit_member(
&self,
server_id: impl Into<String>,
member_id: impl Into<String>,
payload: EditMemberPayload
) -> impl Future<Output = Result<Member, Error>>
pub async fn edit_member( &self, server_id: impl Into<String>, member_id: impl Into<String>, payload: EditMemberPayload ) -> impl Future<Output = 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>,
payload: BanUserPayload
) -> impl Future<Output = Result<ServerBan, Error>>
pub async fn ban_user( &self, server_id: impl Into<String>, user_id: impl Into<String>, payload: BanUserPayload ) -> impl Future<Output = 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>
) -> impl Future<Output = Result<(), Error>>
pub async fn unban_user( &self, server_id: impl Into<String>, user_id: impl Into<String> ) -> impl Future<Output = Result<(), Error>>
Remove a user’s ban.
sourcepub async fn fetch_bans(
&self,
server_id: impl Into<String>
) -> impl Future<Output = Result<BanList, Error>>
pub async fn fetch_bans( &self, server_id: impl Into<String> ) -> impl Future<Output = Result<BanList, Error>>
Fetch all bans on a server.
sourcepub async fn fetch_invites(
&self,
server_id: impl Into<String>
) -> impl Future<Output = Result<PartialInvite, Error>>
pub async fn fetch_invites( &self, server_id: impl Into<String> ) -> impl Future<Output = Result<PartialInvite, Error>>
Fetch all server invites.
source§impl Client
impl Client
sourcepub async fn create_role(
&self,
server_id: impl Into<String>,
payload: CreateRolePayload
) -> impl Future<Output = Result<NewRole, Error>>
pub async fn create_role( &self, server_id: impl Into<String>, payload: CreateRolePayload ) -> impl Future<Output = Result<NewRole, Error>>
Creates a new server role.
sourcepub async fn delete_role(
&self,
server_id: impl Into<String>,
role_id: impl Into<String>
) -> impl Future<Output = Result<(), Error>>
pub async fn delete_role( &self, server_id: impl Into<String>, role_id: impl Into<String> ) -> impl Future<Output = 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>,
payload: EditRolePayload
) -> impl Future<Output = Result<Role, Error>>
pub async fn edit_role( &self, server_id: impl Into<String>, role_id: impl Into<String>, payload: EditRolePayload ) -> impl Future<Output = 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>,
payload: SetServerRolePermissionPayload
) -> impl Future<Output = Result<Server, Error>>
pub async fn set_role_permission( &self, server_id: impl Into<String>, role_id: impl Into<String>, payload: SetServerRolePermissionPayload ) -> impl Future<Output = Result<Server, Error>>
Sets permissions for the specified role in the server.
sourcepub async fn set_default_permission(
&self,
server_id: impl Into<String>,
payload: SetDefaultRolePermissionPayload
) -> impl Future<Output = Result<Server, Error>>
pub async fn set_default_permission( &self, server_id: impl Into<String>, payload: SetDefaultRolePermissionPayload ) -> impl Future<Output = 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>
) -> impl Future<Output = Result<Mutuals, Error>>
pub async fn fetch_mutual_friends_and_servers( &self, id: impl Into<String> ) -> impl Future<Output = 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>
) -> impl Future<Output = Result<User, Error>>
pub async fn accept_friend_request( &self, id: impl Into<String> ) -> impl Future<Output = Result<User, Error>>
Accept another user’s friend request
sourcepub async fn remove_or_deny_friend(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<User, Error>>
pub async fn remove_or_deny_friend( &self, id: impl Into<String> ) -> impl Future<Output = Result<User, Error>>
Denies another user’s friend request or removes an existing friend.
sourcepub async fn block_user(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<User, Error>>
pub async fn block_user( &self, id: impl Into<String> ) -> impl Future<Output = Result<User, Error>>
Block another user by their id.
sourcepub async fn unblock_user(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<User, Error>>
pub async fn unblock_user( &self, id: impl Into<String> ) -> impl Future<Output = Result<User, Error>>
Unblock another user by their id.
sourcepub async fn send_friend_request(
&self,
payload: SendFriendRequestPayload
) -> impl Future<Output = Result<User, Error>>
pub async fn send_friend_request( &self, payload: SendFriendRequestPayload ) -> impl Future<Output = Result<User, Error>>
Send a friend request to another user.
source§impl Client
impl Client
sourcepub async fn fetch_self(&self) -> impl Future<Output = Result<User, Error>>
pub async fn fetch_self(&self) -> impl Future<Output = Result<User, Error>>
Retrieve your user information.
sourcepub async fn edit_user(
&self,
payload: EditUserPayload
) -> impl Future<Output = Result<User, Error>>
pub async fn edit_user( &self, payload: EditUserPayload ) -> impl Future<Output = Result<User, Error>>
Edit currently authenticated user.
sourcepub async fn fetch_user(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<User, Error>>
pub async fn fetch_user( &self, id: impl Into<String> ) -> impl Future<Output = Result<User, Error>>
Fetch a user’s information.
sourcepub async fn change_username(
&self,
payload: ChangeUsernamePayload
) -> impl Future<Output = Result<User, Error>>
pub async fn change_username( &self, payload: ChangeUsernamePayload ) -> impl Future<Output = Result<User, Error>>
Change your username.
sourcepub async fn fetch_default_avatar(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<Vec<u8, Global>, Error>>
pub async fn fetch_default_avatar( &self, id: impl Into<String> ) -> impl Future<Output = Result<Vec<u8, Global>, Error>>
This returns a default avatar based on the given id.
sourcepub async fn fetch_user_profile(
&self,
id: impl Into<String>
) -> impl Future<Output = Result<UserProfile, Error>>
pub async fn fetch_user_profile( &self, id: impl Into<String> ) -> impl Future<Output = Result<UserProfile, Error>>
Retrieve a user’s profile data.
Will fail if you do not have permission to access the other user’s profile.