Enums and Flag Classes

The following section documents everything related to enums and flags.

Enumerations

The API provides some enumerations for certain types of strings to avoid the API from being stringly typed in case the strings change in the future.

All enumerations are subclasses of a custom class which mimics the behavior of enum.Enum.

Enum

class stoat.Enum(value, /)[source]

An enum class that mimics behavior of enum.Enum.

Authentication

class stoat.MFAMethod[source]

Specifies the method of MFA.

password

The MFA is being done using password.

recovery

The MFA is being done using recovery code.

totp

The MFA is being done using TOTP code.

Asset

class stoat.AssetMetadataType[source]

Specifies the metadata type of asset.

file

The file is just a generic uncategorized file.

text

The file contains textual data and should be displayed as such.

image

The file is an image with specific dimensions.

video

The file is a video with specific dimensions.

audio

The file is audio.

Channel

class stoat.ChannelType[source]

Specifies the type of a channel.

saved_messages

A channel accessible only to one user.

private

A private text channel. Also called a direct message.

group

A private group text channel.

text

A text channel.

voice

A voice channel.

unknown

The channel type is unknown.

Discover

class stoat.BotUsage[source]

Specifies bot’s usage.

high

Bot is actively used.

medium

Bot is used but not frequently.

low

Bot is frequently unused.

class stoat.ServerActivity[source]

Specifies server activity.

high

Server is highly active.

medium

Server is active.

low

Server has too low activity.

no

Server has no activity at all.

Embeds

class stoat.BandcampContentType[source]

Specifies type of remote Bandcamp content.

album

A Bandcamp album.

track

A Bandcamp track.

class stoat.ImageSize[source]

Specifies image positioning and size.

large

Show large preview at the bottom of the embed.

preview

Show small preview to the side of the embed.

class stoat.LightspeedContentType[source]

Specifies type of remote Lightspeed.tv content.

channel

A Lightspeed.tv channel.

class stoat.TwitchContentType[source]

Specifies type of remote Twitch content.

channel

A Twitch channel.

video

A Twitch video.

clip

A Twitch clip.

Messages

class stoat.MessageSort[source]

Specifies order of messages.

relevance

Sort messages by relevance.

latest

Sort messages by timestamp in descending order.

oldest

Sort messages by timestamp in ascending order.

OAuth2

class stoat.OAuth2ResponseType[source]

Specifies what code querystring parameter in resulting OAuth2 redirect URL will contain.

Added in version 1.2.

code

The parameter will contain code that should be exchanged.

token

The parameter will contain OAuth2 token.

class stoat.OAuth2GrantType[source]

Specifies the grant type of OAuth2 flow.

Added in version 1.2.

authorization_code

The client will have to ask server to exchange code.

implicit

The client will receive OAuth2 token directly.

class stoat.OAuth2CodeChallengeMethod[source]

Specifies the method of generating OAuth2 code challenge.

Added in version 1.2.

plain

The code challenge will be provided as-is.

s256

The code challenge will be hashed using SHA256.

class stoat.OAuth2Scope[source]

Specifies the scope(s) of OAuth2 token.

Added in version 1.2.

identify

The token can be used to retrieve user's information and friends.

servers

The token can be used to retrieve user's servers.

upload_files

The token can be used to upload files.

events

The token can be used to connect to Gateway on user’s behalf.

full

The token can be used to access entire Stoat HTTP API.

Reporting

class stoat.ContentReportReason[source]

Specifies reason for reporting message or a server.

none

No reason has been specified.

illegal

Illegal content catch-all reason.

illegal_goods

Server or user is selling or facilitating use of drugs or other illegal goods.

illegal_extortion

Extortion or blackmail.

illegal_pornography

Revenge or child pornography.

illegal_hacking

Illegal hacking activity.

extreme_violence

Extreme violence, gore, or animal cruelty, with exception to violence potrayed in media / creative arts.

promotes_harm

Content that promotes harm to others / self.

unsolicited_spam

Unsolicited advertisements.

raid

Server or user is raiding.

spam_abuse

Server or user is spamming or doing other sort of platform abuse.

scams_fraud

Server is scamming or doing fraud.

malware

Server or user is distributing malware or malicious links.

harassment

Harassment or abuse targeted at another user.

class stoat.ReportStatus[source]

Specifies the status of a report.

created

The report was just created and pending.

rejected

The report was rejected.

resolved

The report was resolved.

class stoat.ReportedContentType[source]

Specifies the type of reported content.

message

The content being reported is message.

server

The content being reported is server.

user

The content being reported is user.

Servers

class stoat.MemberRemovalIntention[source]

Specifies reason why member was removed from server.

leave

The member manually left.

kick

The member was kicked.

ban

The member was banned.

Settings

class stoat.Language[source]

Specifies language.

english

English (Traditional)

english_simplified

English (Simplified)

arabic

عربي

assamese

অসমীয়া

azerbaijani

Azərbaycan dili

belarusian

Беларуская

bulgarian

Български

bengali

বাংলা

breton

Brezhoneg

catalonian

Català

cebuano

Bisaya

central_kurdish

کوردی

czech

Čeština

danish

Dansk

german

Deutsch

greek

Ελληνικά

spanish

Español

spanish_latin_america

Español (América Latina)

estonian

eesti

finnish

suomi

filipino

Filipino

french

Français

irish

Gaeilge

hindi

हिन्दी

croatian

Hrvatski

hungarian

Magyar

armenian

հայերեն

indonesian

Bahasa Indonesia

icelandic

Íslenska

italian

Italiano

japense

日本語

korean

한국어

luxembourgish

Lëtzebuergesch

lithuanian

Lietuvių

latvian

Latviešu

macedonian

Македонски

malay

Bahasa Melayu

norwegian_bokmal

Norsk bokmål

dutch

Nederlands

persian

فارسی

polish

Polski

portuguese_brazil

Português (do Brasil)

portuguese_portugal

Português (Portugal)

romanian

Română

russian

Русский

slovak

Slovensky

slovenian

Slovenščina

albanian

Shqip

serbian

Српски

sinhalese

සිංහල

swedish

Svenska

tamil

தமிழ்

thai

ไทย

turkish

Türkçe

urdu

اردو

ukrainian

Українська

venetian

Vèneto

vietnamese

Tiếng Việt

chinese_simplified

简体中文

chinese_traditional

繁體中文

tokipona

Toki Pona

esperanto

Esperanto

owo

OwO

Note

This is joke language.

pirate

Pirate

Note

This is joke language.

bottom

Bottom

Note

This is joke language.

leet

1337

Note

This is joke language.

piglatin

Pig Latin

Note

This is joke language.

enchantment_table

Enchantment Table

Note

This is joke language.

class stoat.AndroidTheme[source]

Specifies client theme for Stoat Android.

revolt

Use legacy colors (used prior to rebranding).

light

Represents the Light theme on Stoat Android.

pure_black

Represents the AMOLED theme on Stoat Android.

system

Use system theme.

material_you

Represents the Material You theme on Stoat Android.

stoat

Use Stoat colors.

class stoat.AndroidFont[source]

Specifies the font to use across UI for Stoat Android app.

default

Use default font.

google_sans_flex

Use Google Sans Flex font.

class stoat.AndroidProfilePictureShape[source]

Specifies rounding grade for profile pictures, including in chat and profiles. This applies to all users on Stoat Android.

sharp

Use sharp rounding grade for profile pictures.

rounded

Use rounded grade for profile pictures.

circular

Use circular rounding grade for profile pictures.

class stoat.AndroidMessageReplyStyle[source]

Specifies a way to quickly reply on Stoat Android.

long_press_to_reply

Long press message to reply.

swipe_to_reply

Swipe from message end to reply.

double_tap_to_reply

Tap twice a message to reply.

class stoat.ReviteChangelogEntry[source]

Represents a Revite changelog entry.

More details about entries may be found here.

mfa_feature

Represents a changelog entry about securing accounts with MFA.

iar_reporting_feature

Represents a changelog entry about in-app reporting messages, servers and users.

discriminators_feature

Represents a changelog entry about adding discriminators.

property created_at

When the changelog entry was created.

property title

The changelog entries’ title.

class stoat.ReviteNotificationState[source]

Specifies the notification’s state.

all_messages

You’re always notified unless you’re busy.

mentions_only

You’re only notified on mentions unless you’re busy.

none

State is not specified. Currently same as muted.

muted

The channel/server is muted.

class stoat.ReviteEmojiPack[source]

Specifies the emoji pack to render.

mutant_remix

Use ‘Mutant Remix’ emoji pack.

twemoji

Use ‘Twemoji’ emoji pack.

openmoji

Use ‘Openmoji’ emoji pack.

noto_emoji

Use ‘Noto Emoji’ emoji pack.

class stoat.ReviteBaseTheme[source]

Represents the Revite client theme.

light

Represents the Light theme on Stoat.

dark

Represents the Dark theme on Stoat.

class stoat.ReviteFont[source]

Specifies the font in Revite client.

open_sans

Represents ‘Open Sans’ font.

opendyslexic

Represents ‘OpenDyslexic’ font.

inter

Represents ‘Inter’ font.

Note

This font supports ligatures.

atkinson_hyperlegible

Represents ‘Atkinson Hyperlegible’ font.

roboto

Represents ‘Roboto’ font.

noto_sans

Represents ‘Noto Sans’ font.

lato

Represents ‘Lato’ font.

bitter

Represents ‘Bitter’ font.

montserrat

Represents ‘Montserrat’ font.

poppins

Represents ‘Poppins’ font.

raleway

Represents ‘Raleway’ font.

ubuntu

Represents ‘Ubuntu’ font.

comic_neue

Represents ‘Comic Neue’ font.

lexend

Represents ‘Lexend’ font.

class stoat.ReviteMonoFont[source]

Specifies the font inside codeblocks in Revite client.

fira_code

Represents ‘Fira Code’ mont.

roboto_mono

Represents ‘Roboto Mono’ mont.

source_code_pro

Represents ‘Source Code Pro’ mont.

space_mono

Represents ‘Space Mono’ mont.

ubuntu_mono

Represents ‘Ubuntu Mono’ mont.

jetbrains_mono

Represents ‘JetBrains Mono’ mont.

Shard

class stoat.ShardFormat[source]

Specifies WebSocket format the shard should communicate in.

json

Communicate using JSON.

Recommended for testing.

msgpack

Communicate using MessagePack format.

Recommended for production due to being most efficient format.

Users

class stoat.Presence[source]

Specifies the presence of an user.

online

The user is online.

idle

The user is currently not available.

focus

The user is focusing and will only receive mentions.

busy

The user is busy and will not receive any notifications.

invisible
The user appears to be offline to other users.
class stoat.RelationshipStatus[source]

Specifies the relationship of current user and another user (or themselves).

none

No relationship.

user

This user is you.

friend

This user is friends with you.

outgoing

You sent friend request to this user.

incoming

This user sent friend request to you.

blocked

You blocked this user.

blocked_other

This user blocked you.

class stoat.UserReportReason[source]

Specifies reason for user report.

none

No reason has been specified.

unsolicited_spam

User is sending unsolicited advertisements.

spam_abuse

User is sending spam or abusing the platform.

inappropriate_profile

User’s profile contains inappropriate content for a general audience.

impersonation

User is impersonating another user.

ban_evasion

User is evading a ban.

underage

User is not of minimum age to use the platform.

Flag Classes

BaseFlags

class stoat.BaseFlags[source]

Base class for flags.

classmethod all()[source]

Returns instance with all flags.

classmethod none()[source]

Returns instance with no flags.

copy()[source]

Copies the flag value.

is_subset(other, /)[source]

bool: Returns True if self has the same or fewer flags as other.

is_superset(other, /)[source]

bool: Returns True if self has the same or more flags as other.

is_strict_subset(other, /)[source]

bool: Returns True if the flags on other are a strict subset of those on self.

is_strict_superset(other, /)[source]

bool: Returns True if the flags on other are a strict superset of those on self.

stoat.flag(*, inverted=False, use_any=False, alias=False)[source]
stoat.doc_flags(intro, /, *, added_in=None)[source]

Document flag classes.

Parameters:
  • intro (str) – The intro.

  • added_in (Optional[str]) – The version the flags were added in.

Returns:

The documented class.

Return type:

Callable[[Type[BF]], Type[BF]]

BotFlags

class stoat.BotFlags(value=0, /)[source]

Wraps up a Stoat Bot flag value.

x == y

Checks if two flags are equal.

x != y

Checks if two flags are not equal.

x | y, x |= y

Returns a BotFlags instance with all enabled flags from both x and y.

x & y, x &= y

Returns a BotFlags instance with only flags enabled on both x and y.

x ^ y, x ^= y

Returns a BotFlags instance with only flags enabled on only one of x or y, not on both.

~x

Returns a BotFlags instance with all flags inverted from x.

hash(x)

Return the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs.

bool(b)

Returns whether any flag is set to True.

value

The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value.

Type:

int

verified

Whether the bot is verified.

Type:

bool

official

Whether the bot is created by Stoat.

Type:

bool

classmethod all()[source]

Returns instance with all flags.

copy()[source]

Copies the flag value.

is_strict_subset(other, /)[source]

bool: Returns True if the flags on other are a strict subset of those on self.

is_strict_superset(other, /)[source]

bool: Returns True if the flags on other are a strict superset of those on self.

is_subset(other, /)[source]

bool: Returns True if self has the same or fewer flags as other.

is_superset(other, /)[source]

bool: Returns True if self has the same or more flags as other.

classmethod none()[source]

Returns instance with no flags.

MessageFlags

class stoat.MessageFlags(value=0, /)[source]

Wraps up a Message flag value.

x == y

Checks if two flags are equal.

x != y

Checks if two flags are not equal.

x | y, x |= y

Returns a MessageFlags instance with all enabled flags from both x and y.

x & y, x &= y

Returns a MessageFlags instance with only flags enabled on both x and y.

x ^ y, x ^= y

Returns a MessageFlags instance with only flags enabled on only one of x or y, not on both.

~x

Returns a MessageFlags instance with all flags inverted from x.

hash(x)

Return the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs.

bool(b)

Returns whether any flag is set to True.

value

The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value.

Type:

int

suppress_notifications

Whether the message will not send push/desktop notifications.

Type:

bool

mention_everyone

Whether the message will mention all users who can see the channel.

Type:

bool

mention_online

Whether the message will mention all users who are online and can see the channel.

Note

If this is True, then mention_everyone cannot be True either.

Type:

bool

classmethod all()[source]

Returns instance with all flags.

copy()[source]

Copies the flag value.

is_strict_subset(other, /)[source]

bool: Returns True if the flags on other are a strict subset of those on self.

is_strict_superset(other, /)[source]

bool: Returns True if the flags on other are a strict superset of those on self.

is_subset(other, /)[source]

bool: Returns True if self has the same or fewer flags as other.

is_superset(other, /)[source]

bool: Returns True if self has the same or more flags as other.

classmethod none()[source]

Returns instance with no flags.

Permissions

class stoat.Permissions(value=0, /, **kwargs)[source]

Wraps up a Permission flag value.

x == y

Checks if two flags are equal.

x != y

Checks if two flags are not equal.

x | y, x |= y

Returns a Permissions instance with all enabled flags from both x and y.

x & y, x &= y

Returns a Permissions instance with only flags enabled on both x and y.

x ^ y, x ^= y

Returns a Permissions instance with only flags enabled on only one of x or y, not on both.

~x

Returns a Permissions instance with all flags inverted from x.

hash(x)

Return the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs.

bool(b)

Returns whether any flag is set to True.

value

The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value.

Type:

int

manage_channels

Whether the user can edit, delete, or create channels in the server.

This also corresponds to the “Manage Channel” channel-specific override.

Type:

bool

manage_server

Whether the user can edit server properties.

Type:

bool

manage_permissions

Whether the user can manage permissions on server or channels.

Type:

bool

manage_roles

Whether the user can manage roles on server.

Type:

bool

manage_customization

Whether the user can manage server customization (includes emoji).

Type:

bool

classmethod generic()[source]

Permissions: Returns generic permissions.

kick_members

Whether the user can kick other members below their ranking.

Type:

bool

ban_members

Whether the user can ban other members below their ranking.

Type:

bool

timeout_members

Whether the user can timeout other members below their ranking.

Type:

bool

assign_roles

Whether the user can assign roles to members below their ranking.

Type:

bool

change_nickname

Whether the user can change own nick.

Type:

bool

manage_nicknames

Whether the user can change or remove other’s nicknames below their ranking.

Type:

bool

change_avatar

Whether the user can change own avatar.

Type:

bool

remove_avatars

Whether the user can remove other’s avatars below their ranking.

Type:

bool

classmethod member()[source]

Permissions: Returns member-related permissions.

view_channel

Whether the user can view a channel.

Type:

bool

read_message_history

Whether the user can read a channel’s past message history.

Type:

bool

send_messages

Whether the user can send messages.

Type:

bool

manage_messages

Whether the user can delete other’s messages (or pin them) in a channel.

Type:

bool

manage_webhooks

Whether user can manage webhooks that belong to a channel.

Type:

bool

create_invites

Whether user can create invites to this channel.

Type:

bool

send_embeds

Whether user can send embedded content in this channel.

Type:

bool

upload_files

Whether user can send attachments and media in this channel.

Type:

bool

use_masquerade

Whether the user can use masquerade on own messages with custom nickname and avatar.

Type:

bool

react

Whether the user can react to messages with emojis.

Type:

bool

mention_everyone

Whether the user can mention everyone and online members.

Type:

bool

mention_roles

Whether the user can mention roles.

Type:

bool

classmethod channel()[source]

Permissions: Returns channel-related permissions.

connect

Whether the user can connect to a voice channel.

Type:

bool

speak

Whether the user can speak in a voice call.

Type:

bool

video

Whether the user can share video in a voice call.

Type:

bool

mute_members

Whether user can mute other members with lower ranking in a voice call.

Type:

bool

deafen_members

Whether user can deafen other members with lower ranking in a voice call.

Type:

bool

move_members

Whether the user can move members between voice channels.

Type:

bool

listen

Whether the user can listen to other users in voice channel.

Type:

bool

classmethod voice()[source]

Permissions: Returns voice-related permissions.

classmethod all()[source]

Returns instance with all flags.

copy()[source]

Copies the flag value.

is_strict_subset(other, /)[source]

bool: Returns True if the flags on other are a strict subset of those on self.

is_strict_superset(other, /)[source]

bool: Returns True if the flags on other are a strict superset of those on self.

is_subset(other, /)[source]

bool: Returns True if self has the same or fewer flags as other.

is_superset(other, /)[source]

bool: Returns True if self has the same or more flags as other.

classmethod none()[source]

Returns instance with no flags.

stoat.ALLOW_PERMISSIONS_IN_TIMEOUT

The permissions that are only allowed when user is timed out.

stoat.VIEW_ONLY_PERMISSIONS

The permissions that are allowed when user can view channel.

stoat.DEFAULT_PERMISSIONS

The default permissions.

stoat.DEFAULT_SAVED_MESSAGES_PERMISSIONS

The default permissions in SavedMessagesChannel.

stoat.DEFAULT_DM_PERMISSIONS

The default permissions in DMChannel.

stoat.DEFAULT_SERVER_PERMISSIONS

The default permissions in Server.

UserPermissions

class stoat.UserPermissions(value=0, /, **kwargs)[source]

Wraps up an user permission flag value.

x == y

Checks if two flags are equal.

x != y

Checks if two flags are not equal.

x | y, x |= y

Returns a UserPermissions instance with all enabled flags from both x and y.

x & y, x &= y

Returns a UserPermissions instance with only flags enabled on both x and y.

x ^ y, x ^= y

Returns a UserPermissions instance with only flags enabled on only one of x or y, not on both.

~x

Returns a UserPermissions instance with all flags inverted from x.

hash(x)

Return the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs.

bool(b)

Returns whether any flag is set to True.

value

The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value.

Type:

int

access

Whether the user can access data of this user.

Type:

bool

view_profile

Whether the user can view this user’s profile.

Type:

bool

send_messages

Whether the user can send messages to this user.

Type:

bool

invite

Whether the user can invite this user to groups.

Type:

bool

classmethod all()[source]

Returns instance with all flags.

copy()[source]

Copies the flag value.

is_strict_subset(other, /)[source]

bool: Returns True if the flags on other are a strict subset of those on self.

is_strict_superset(other, /)[source]

bool: Returns True if the flags on other are a strict superset of those on self.

is_subset(other, /)[source]

bool: Returns True if self has the same or fewer flags as other.

is_superset(other, /)[source]

bool: Returns True if self has the same or more flags as other.

classmethod none()[source]

Returns instance with no flags.

ServerFlags

class stoat.ServerFlags(value=0, /, **kwargs)[source]

Wraps up a server flag value.

x == y

Checks if two flags are equal.

x != y

Checks if two flags are not equal.

x | y, x |= y

Returns a ServerFlags instance with all enabled flags from both x and y.

x & y, x &= y

Returns a ServerFlags instance with only flags enabled on both x and y.

x ^ y, x ^= y

Returns a ServerFlags instance with only flags enabled on only one of x or y, not on both.

~x

Returns a ServerFlags instance with all flags inverted from x.

hash(x)

Return the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs.

bool(b)

Returns whether any flag is set to True.

value

The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value.

Type:

int

verified

Whether the server is verified.

Type:

bool

official

Whether the server is ran by Stoat team.

Type:

bool

classmethod all()[source]

Returns instance with all flags.

copy()[source]

Copies the flag value.

is_strict_subset(other, /)[source]

bool: Returns True if the flags on other are a strict subset of those on self.

is_strict_superset(other, /)[source]

bool: Returns True if the flags on other are a strict superset of those on self.

is_subset(other, /)[source]

bool: Returns True if self has the same or fewer flags as other.

is_superset(other, /)[source]

bool: Returns True if self has the same or more flags as other.

classmethod none()[source]

Returns instance with no flags.

UserBadges

class stoat.UserBadges(value=0, /, **kwargs)[source]

Wraps up an user badges flag value.

x == y

Checks if two flags are equal.

x != y

Checks if two flags are not equal.

x | y, x |= y

Returns a UserBadges instance with all enabled flags from both x and y.

x & y, x &= y

Returns a UserBadges instance with only flags enabled on both x and y.

x ^ y, x ^= y

Returns a UserBadges instance with only flags enabled on only one of x or y, not on both.

~x

Returns a UserBadges instance with all flags inverted from x.

hash(x)

Return the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs.

bool(b)

Returns whether any flag is set to True.

value

The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value.

Type:

int

developer

Whether user is Stoat developer.

Type:

bool

translator

Whether the user helped translate Stoat.

Type:

bool

supporter

Whether the user monetarily supported Stoat.

Type:

bool

responsible_disclosure

Whether the user have responsibly disclosed a security issue.

Type:

bool

founder

Whether the user is a Stoat founder.

Type:

bool

platform_moderation

Whether the user is a platform moderator.

Type:

bool

active_supporter

Whether the user is active monetary supporter.

Type:

bool

paw

Whether the user likes 🦊 and 🦝.

Type:

bool

early_adopter

Whether the user joined as one of the first 1000 users in 2021.

Type:

bool

reserved_relevant_joke_badge_1

Whether the user is have given some funny joke.

This is displayed as amogus (with ‘sus’ label) in Revite.

Type:

bool

reserved_relevant_joke_badge_2

Whether the user is have given some funny joke.

This is displayed as amorbus (Amogus with Morbin texture) in Revite, and as ‘Low resolution troll face’ in new client.

Type:

bool

classmethod all()[source]

Returns instance with all flags.

copy()[source]

Copies the flag value.

is_strict_subset(other, /)[source]

bool: Returns True if the flags on other are a strict subset of those on self.

is_strict_superset(other, /)[source]

bool: Returns True if the flags on other are a strict superset of those on self.

is_subset(other, /)[source]

bool: Returns True if self has the same or fewer flags as other.

is_superset(other, /)[source]

bool: Returns True if self has the same or more flags as other.

classmethod none()[source]

Returns instance with no flags.

UserFlags

class stoat.UserFlags(value=0, /, **kwargs)[source]

Wraps up an user flags flag value.

x == y

Checks if two flags are equal.

x != y

Checks if two flags are not equal.

x | y, x |= y

Returns a UserFlags instance with all enabled flags from both x and y.

x & y, x &= y

Returns a UserFlags instance with only flags enabled on both x and y.

x ^ y, x ^= y

Returns a UserFlags instance with only flags enabled on only one of x or y, not on both.

~x

Returns a UserFlags instance with all flags inverted from x.

hash(x)

Return the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs.

bool(b)

Returns whether any flag is set to True.

value

The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value.

Type:

int

suspended

Whether the user has been suspended from the platform.

Type:

bool

deleted

Whether the user has deleted their account.

Type:

bool

classmethod all()[source]

Returns instance with all flags.

banned

Whether the user was banned off the platform.

Type:

bool

copy()[source]

Copies the flag value.

is_strict_subset(other, /)[source]

bool: Returns True if the flags on other are a strict subset of those on self.

is_strict_superset(other, /)[source]

bool: Returns True if the flags on other are a strict superset of those on self.

is_subset(other, /)[source]

bool: Returns True if self has the same or fewer flags as other.

is_superset(other, /)[source]

bool: Returns True if self has the same or more flags as other.

classmethod none()[source]

Returns instance with no flags.

spam

Whether the user was marked as spam and removed from platform.

Type:

bool