User
Representation of a Fluxer user. Stored in theclient.users cache.
Fields
Constructors
User::from_api
User from an API response. flags is taken from flags or public_flags - whichever is non-empty first.
User::unknown
username = "Unknown" and an empty id. Use when user data is unavailable.
Methods
display_name
global_name if set, otherwise username.
mention
<@id>. The Display trait is implemented identically.
avatar_url
None if avatar is None.
URL format: https://fluxerusercontent.com/avatars/{user_id}/{hash}.{ext}.
For animated avatars (hash starts with a_) the extension is automatically set to gif.
display_avatar_url
avatar_url, but falls back to the default avatar URL (https://fluxerstatic.com/avatars/{index}.png) instead of returning None.
banner_url
None if banner is None.
create_dm
Example: open a DM and send a message
Example: open a DM and send a message
patch
User fields with data from the API. Called automatically by the client on USER_UPDATE and when a cached user is encountered again.
GuildMember
Representation of a guild member. Stored in theclient.members[guild_id][user_id] cache.
Fields
Constructors
GuildMember::from_api
GuildMember from an API response and a guild ID.
Methods
display_name
nick if set, otherwise user.display_name().
mention
<@user_id>.
has_role
true if the role ID is in roles.
timeout_active
true if communication_disabled_until is set and the date has not yet passed.
Example: check a member's role and display their nick
Example: check a member's role and display their nick
Example: fetch a member via REST
Example: fetch a member via REST
ClientUser
The bot’s own account data. Available viaclient.user() after a successful login.
Fields
Access
CdnOptions
Used inavatar_url, banner_url, icon_url, and similar methods.
Example: get a 256px avatar in webp format
Example: get a 256px avatar in webp format
