GuildWidget
Represents a Guild
's widget.
Attributes
int
Estimated count of the online users in the respective guild.
Voice channels received with the guild widget.
int
The unique identifier number of the guild widget's guild.
None
, str
The guild widget's invite url if applicable.
str
The name of the guild widget's guild.
Online users received with the guild widget.
Properties
created_at
When the entity was created.
Returns
created_at : datetime
guild
Returns the parent guild of the widget. If it is not in cache creates a new one.
Returns
guild : Guild
json_url
Returns an url to request a Guild
's widget data.
This function is a shared property of Guild
, GuildWidget
.
Returns
url : str
Methods
(...)
__new__Creates a new guild widget from the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
approximate_online_count |
| Estimated count of the online users in the respective guild. | ||
channels |
| Voice channels received with the guild widget. | ||
id |
| The unique identifier number of the guild widget's guild. | ||
invite_url |
| The guild widget's invite url if applicable. | ||
name |
| The name of the guild widget's guild. | ||
users |
| Online users received with the guild widget. |
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
()
copyCopies the guild widget.
Returns
new : instance<type<self>>
(...)
copy_withCopies the guild widget from the given parameters.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
approximate_online_count |
| Estimated count of the online users in the respective guild. | ||
channels |
| Voice channels received with the guild widget. | ||
id |
| The unique identifier number of the guild widget's guild. | ||
invite_url |
| The guild widget's invite url if applicable. | ||
name |
| The name of the guild widget's guild. | ||
users |
| Online users received with the guild widget. |
Returns
new : instance<type<self>>
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
(data)
from_dataCreates a new guild widget from the given data.
Parameter | Type | Description |
---|---|---|
data |
| The requested guild widget data. |
Returns
self : instance<cls>
()
iter_channelsIterates over the widget channels.
This method is an iterable generator.
Yields
channel : GuildWidgetChannel
()
iter_users(defaults)
to_dataSerializes the guild widget.
Parameter | Type | Description |
---|---|---|
defaults |
| Whether fields of their default value should be included as well. |
Returns
data : dict
of (str
, object
) items
(other)
_is_equal_same_typeReturns whether the two types are equal.
Helper method for .__eq__
Parameter | Type | Description |
---|---|---|
other |
| The other instance. Must be from the same type. |
Returns
is_equal : bool
()
__eq__Returns whether the two guild widget are equal.
()
__ge__Whether this entity's id is greater or equal than the other's.
()
__getattr__Drops a rich attribute error.
()
__gt__Whether this entity's id is greater than the other's.
()
__hash__Returns the has value of the guild widget.
()
__le__Whether this entity's id is less or equal than the other's.
()
__lt__Whether this entity's id is less than the other's.
()
__ne__Returns whether the two guild widget are not equal.
()
__repr__Returns the representation of the guild widget.