pub enum UserResult {
User(User),
UserFlags(UserFlags),
UserProfile(UserProfile),
UserDmChannels(Vec<UserDmChannels>),
UserDms(UserDms),
UserMutuals(UserMutuals),
String(String),
}Expand description
The enum for data returning
The variations of this enum are the types that are returned after .run() is called
Note!:
If any of the methods that impliment this enum are called the type will change
Variants§
User(User)
UserFlags(UserFlags)
UserProfile(UserProfile)
UserDmChannels(Vec<UserDmChannels>)
UserDms(UserDms)
UserMutuals(UserMutuals)
String(String)
Implementations§
Source§impl UserResult
impl UserResult
Sourcepub fn discriminator(&self) -> String
pub fn discriminator(&self) -> String
Sourcepub fn badges(&self) -> Vec<&str>
pub fn badges(&self) -> Vec<&str>
Returns the badges a users has
Badges can be earned on Revolt for different things (will explain below)
The API shows badges as the sum of the values of all the badges
Badge Values:
- 1: Developer (Develops Revolt)
- 2: Translator (Translated Revolt into another language)
- 4: Supporter (Supported Revolt with a donation)
- 8: Responsibly Disclosed Bug(s) (Disclosed a bug responibly)
- 16: Founder (Founded Revolt)
- 32: Platform Moderation (Moderates Revolt)
- 64: Active Supporter (Activlty supports Revolt)
- 128: Paw (🦊🦝)
- 256: Early Adopter (One of the first 1000 users)
- 512: ReservedRelevantJokeBadge1 (Amogus)
- 1024 ReservedRelevantJokeBadge2 (Amogus Troll Face)
§Returns
A vec<&str> of the badges the user has earned in order from highest value to lowest value
§Panics!:
This funtion will panic if the enum variant UserResult::User has not been called
Sourcepub fn background(&self) -> Image
pub fn background(&self) -> Image
Sourcepub fn status(&self) -> String
pub fn status(&self) -> String
Returns the status text of a user
§Returns:
The status text of a user as a string
Note:
This function takes both UserResult::UserProfile and UserResult::User
When UserResult::User is called the value may be “None” if there was no status or there was and error parsing the status
§Panics!:
This function will panic if fetch_user_flags was called before
Sourcepub fn mutual_users(&self) -> Vec<String>
pub fn mutual_users(&self) -> Vec<String>
Trait Implementations§
Source§impl Clone for UserResult
impl Clone for UserResult
Source§fn clone(&self) -> UserResult
fn clone(&self) -> UserResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UserResult
impl Debug for UserResult
Source§impl<'de> Deserialize<'de> for UserResult
impl<'de> Deserialize<'de> for UserResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for UserResult
impl PartialEq for UserResult
Source§fn eq(&self, other: &UserResult) -> bool
fn eq(&self, other: &UserResult) -> bool
self and other values to be equal, and is used by ==.