DiscoveryCategory
Represents a category of a GuildDiscovery
.
Attributes
str
The default name of the discovery category.
The category's name in other languages.
bool
Whether this category can be set as a guild's primary category.
int
The Discord side identifier value of the discovery category.
Class Attributes
str
= 'Undefined'
The default name of the discovery categories.
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.
type
= str
The discovery categories' values' type.
Every predefined discovery category is also stored as a class attribute:
Class attribute name | id | name | primary |
---|---|---|---|
general | 0 | 'General' | True |
gaming | 1 | 'Gaming' | True |
music | 2 | 'Music' | True |
entertainment | 3 | 'Entertainment' | True |
creative_arts | 4 | 'Creative Arts' | True |
science_and_tech | 5 | 'Science & Tech' | True |
education | 6 | 'Education' | True |
sports | 7 | 'Sports' | True |
fashion_and_beauty | 8 | 'Fashion & Beauty' | True |
relationships_and_identity | 9 | 'Relationships & Identity' | True |
travel_and_food | 10 | 'Travel & Food' | True |
fitness_and_health | 11 | 'Fitness & Health' | True |
finance | 12 | 'Finance' | True |
other | 13 | 'Other' | True |
general_chatting | 14 | 'General Chatting' | True |
esports | 15 | 'Esports' | False |
anime_and_manga | 16 | 'Anime & Manga' | False |
movies_and_tv | 17 | 'Movies & TV' | False |
books | 18 | 'Books' | False |
art | 19 | 'Art' | False |
writing | 20 | 'Writing' | False |
crafts_diy_and_making | 21 | 'Crafts, DIY, & Making' | False |
programming | 22 | 'Programming' | False |
podcasts | 23 | 'Podcasts' | False |
tabletop_games | 24 | 'Tabletop Games' | False |
memes | 25 | 'Memes' | False |
news_and_current_events | 26 | 'News & Current Events' | False |
cryptocurrency | 27 | 'Cryptocurrency' | False |
investing | 28 | 'Investing' | False |
studying_and_teaching | 29 | 'Studying & Teaching' | False |
lfg | 30 | 'LFG' | False |
customer_support | 31 | 'Customer Support' | False |
theorycraft | 32 | 'Theorycraft' | False |
events | 33 | 'Events' | False |
roleplay | 34 | 'Roleplay' | False |
content_creator | 35 | 'Content Creator' | False |
business | 36 | 'Business' | False |
local_group | 37 | 'Local Group' | False |
collaboration | 38 | 'Collaboration' | False |
fandom | 39 | 'Fandom' | False |
wiki_and_guide | 40 | 'Wiki & Guide' | False |
subreddit | 42 | 'Subreddit' | False |
emoji | 43 | 'Emoji' | False |
comics_and_cartoons | 44 | 'Comics & Cartoons' | False |
mobile | 45 | 'Mobile' | False |
console | 46 | 'Console' | False |
charity_and_nonprofit | 47 | 'Charity & Nonprofit' | False |
Methods
(value, name, primary)
__init__Creates a new discovery category from the given parameters.
Parameter | Type | Description |
---|---|---|
value |
| The unique identifier number of the discovery category. |
name |
| The category's name. |
primary |
| Whether this category can be set as a guild's primary category. |
(data)
from_dataCreates a new discovery category from the given data. if the discovery category already exists returns that instead.
Parameter | Type | Description |
---|---|---|
data |
| Discovery category data. |
Returns
self : instance<cls>
(value)
getReturns the value's representation. If the value is already preinstanced, returns that, else creates a new object.
Parameter | Type | Description |
---|---|---|
value |
| The value to get it's representation. |
Returns
obj_ : PreinstancedBase
(...)
to_dataConvert the discovery category to a json serializable dictionary.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
defaults |
|
| Whether default values should be included as well. | ||
include_internals |
|
| Whether internal fields should be included as well. |
Returns
data : dict
of (str
, object
) items
(value)
_from_valueCreates a new discovery category with the given value.
Parameter | Type | Description |
---|---|---|
value |
| 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.