DiscoveryCategory

Represents a category of a GuildDiscovery.

Attributes

name : str

The default name of the discovery category.

name_localizations : None, dict of (Locale, str) items

The category's name in other languages.

primary : bool

Whether this category can be set as a guild's primary category.

value : int

The Discord side identifier value of the discovery category.

Class Attributes

DEFAULT_NAME : str = 'Undefined'

The default name of the discovery categories.

INSTANCES : dict of (str, DiscoveryCategory) items

Stores the predefined discovery categories. This container is accessed when translating a Discord side identifier of a discovery category. The identifier value is used as a key to get it's wrapper side representation.

VALUE_TYPE : type = str

The discovery categories' values' type.

Every predefined discovery category is also stored as a class attribute:

Class attribute nameidnameprimary
general0'General'True
gaming1'Gaming'True
music2'Music'True
entertainment3'Entertainment'True
creative_arts4'Creative Arts'True
science_and_tech5'Science & Tech'True
education6'Education'True
sports7'Sports'True
fashion_and_beauty8'Fashion & Beauty'True
relationships_and_identity9'Relationships & Identity'True
travel_and_food10'Travel & Food'True
fitness_and_health11'Fitness & Health'True
finance12'Finance'True
other13'Other'True
general_chatting14'General Chatting'True
esports15'Esports'False
anime_and_manga16'Anime & Manga'False
movies_and_tv17'Movies & TV'False
books18'Books'False
art19'Art'False
writing20'Writing'False
crafts_diy_and_making21'Crafts, DIY, & Making'False
programming22'Programming'False
podcasts23'Podcasts'False
tabletop_games24'Tabletop Games'False
memes25'Memes'False
news_and_current_events26'News & Current Events'False
cryptocurrency27'Cryptocurrency'False
investing28'Investing'False
studying_and_teaching29'Studying & Teaching'False
lfg30'LFG'False
customer_support31'Customer Support'False
theorycraft32'Theorycraft'False
events33'Events'False
roleplay34'Roleplay'False
content_creator35'Content Creator'False
business36'Business'False
local_group37'Local Group'False
collaboration38'Collaboration'False
fandom39'Fandom'False
wiki_and_guide40'Wiki & Guide'False
subreddit42'Subreddit'False
emoji43'Emoji'False
comics_and_cartoons44'Comics & Cartoons'False
mobile45'Mobile'False
console46'Console'False
charity_and_nonprofit47'Charity & Nonprofit'False

Methods

__init__(value, name, primary)

Creates a new discovery category from the given parameters.

ParameterTypeDescription
value

int

The unique identifier number of the discovery category.

name

str

The category's name.

primary

bool

Whether this category can be set as a guild's primary category.

from_data(data)

Creates a new discovery category from the given data. if the discovery category already exists returns that instead.

ParameterTypeDescription
data

dict of (str, object) items

Discovery category data.

Returns

self : instance<cls>

get(value)

Returns the value's representation. If the value is already preinstanced, returns that, else creates a new object.

ParameterTypeDescription
value

None, .VALUE_TYPE

The value to get it's representation.

Returns

obj_ : PreinstancedBase

to_data(...)

Convert the discovery category to a json serializable dictionary.

ParameterTypeOptionalKeyword onlyDefaultDescription
defaults

bool

False

Whether default values should be included as well.

include_internals

bool

False

Whether internal fields should be included as well.

Returns

data : dict of (str, object) items

_from_value(value)

Creates a new discovery category with the given value.

ParameterTypeDescription
value

int

The discovery category's identifier value.

Returns

self : instance<cls>

The created instance.

__eq__()

Returns whether self's value equals to the other object's.

__ge__()

Returns whether self's value is greater or equal to the other object's.

__getattr__()

Drops a rich attribute error.

__gt__()

Returns whether self's value is greater than the other object's.

__hash__()

Returns the hash of the preinstanced object.

__le__()

Returns whether self's value is less or equal to the other object's.

__lt__()

Returns whether self's value is less than the other object's.

__ne__()

Returns whether self's not equals to the other object's.

__repr__()

Returns the discovery category's representation.