Skip to content

discry.enums

Closed sets used by the scraper, the snapshot files, and the command line.

StrEnum

Bases: str, Enum

Enum whose members are also strings.

The standard library class arrived in Python 3.11. This one keeps the same behavior on the older versions this package still runs on. Members compare equal to their string values.

Attributes:

Name Type Description
value str

Text stored on the member.

__new__

__new__(value)

Create a member that is also a string.

Parameters:

Name Type Description Default
value str

Member text.

required

Returns:

Name Type Description
StrEnum StrEnum

The new member.

__str__

__str__()

Return the member text.

Returns:

Name Type Description
str str

The value passed when the member was defined.

__format__

__format__(format_spec)

Format the member as its text.

Parameters:

Name Type Description Default
format_spec str

Format spec applied to the value.

required

Returns:

Name Type Description
str str

Formatted member text.

ReleaseChannel

Bases: StrEnum

Built-in Discord web release channels.

A config file may name further channels when each one has a domain. Members compare equal to their string values.

Attributes:

Name Type Description
STABLE str

Production client.

PTB str

Public test build.

CANARY str

Canary client.

GatewayEncoding

Bases: StrEnum

Gateway payload encodings the web client offers.

Attributes:

Name Type Description
JSON str

JSON text frames.

ETF str

Erlang term format frames.

GatewayCompress

Bases: StrEnum

Gateway compression modes named in the web client.

Attributes:

Name Type Description
ZSTD_STREAM str

zstd streaming compression.

ZLIB_STREAM str

zlib streaming compression.

AssetExtension

Bases: StrEnum

Content-hashed file extensions linked from the app page.

Attributes:

Name Type Description
JS str

JavaScript bundle.

CSS str

Stylesheet.

MJS str

ES module bundle.

EnvKey

Bases: StrEnum

Canonical GLOBAL_ENV names.

Lookups also accept camelCase and lower_snake spellings of each name.

Attributes:

Name Type Description
BUILD_NUMBER str

Client build number.

VERSION_HASH str

Build hash stamped into the page.

BUILT_AT str

Build timestamp.

RELEASE_CHANNEL str

Channel name baked into the page.

API_VERSION str

REST API version.

GATEWAY_ENDPOINT str

Gateway websocket URL.

API_ENDPOINT str

REST API host.

REMOTE_AUTH_ENDPOINT str

Remote auth gateway URL.

CDN_HOST str

CDN hostname.

MEDIA_PROXY_ENDPOINT str

Media proxy host.

IMAGE_PROXY_ENDPOINTS str

Image proxy hosts.

RTC_LATENCY_ENDPOINT str

Voice latency probe URL.

NETWORKING_ENDPOINT str

Router host.

INVITE_HOST str

Invite link host.

GIFT_CODE_HOST str

Gift link host.

GUILD_TEMPLATE_HOST str

Server template host.

ACTIVITY_APPLICATION_HOST str

Activity iframe host.

STRIPE_KEY str

Stripe publishable key.

ADYEN_KEY str

Adyen client key.

BRAINTREE_KEY str

Braintree client key.

PUBLIC_PATH str

Static asset path prefix.

SENTRY_RELEASE str

Sentry release name.

EnvMarker

Bases: StrEnum

Text that introduces a GLOBAL_ENV object in the app page.

Attributes:

Name Type Description
WINDOW str

window.GLOBAL_ENV assignment.

BARE str

GLOBAL_ENV mention without the window prefix.

ScriptKind

Bases: StrEnum

App script prefixes fetched before the rest of the page.

Declaration order is fetch order. Earlier members are downloaded first.

Attributes:

Name Type Description
FAST_CONNECT str

Identify payload chunk.

WEB str

Main web entry chunk.

SENTRY str

Sentry loader chunk.

rank

rank()

Return this script's fetch order.

Returns:

Name Type Description
int int

Zero-based rank. Lower values are fetched first.

ResponseHeader

Bases: StrEnum

Response header names read from the app page.

Attributes:

Name Type Description
BUILD_ID str

Build hash header.

LAST_MODIFIED str

Page modification time.

DataFile

Bases: StrEnum

JSON files written under the data directory.

Attributes:

Name Type Description
LATEST str

Current snapshot of every channel.

HISTORY str

Rows appended when identity or capabilities change.

ExitCode

Bases: IntEnum

Process status codes returned by the command line.

Attributes:

Name Type Description
SUCCESS int

The run finished.

FAILURE int

Configuration, fetch, or scrape failed.

TruthyText

Bases: StrEnum

Text accepted as true in config and environment variables.

Attributes:

Name Type Description
ONE str

Digit one.

TRUE str

Word true.

YES str

Word yes.

ON str

Word on.

FalsyText

Bases: StrEnum

Text accepted as false in config and environment variables.

Attributes:

Name Type Description
ZERO str

Digit zero.

FALSE str

Word false.

NO str

Word no.

OFF str

Word off.

ClearedText

Bases: StrEnum

Text that clears an optional string setting.

Attributes:

Name Type Description
ZERO str

Digit zero.

FALSE str

Word false.

NONE str

Word none.

OFF str

Word off.