Guild Events¶
Note
The following classes come from the scurrypy.events.guild_events module.
GuildCreateEvent
dataclass
¶
Bases: Event, GuildModel
Received when the bot has joined a guild.
joined_at: str
instance-attribute
¶
ISO8601 timestamp of when app joined the guild.
large: bool
instance-attribute
¶
If the guild is considered large.
member_count: int
instance-attribute
¶
Total number of members in the guild.
members: list[GuildMemberModel]
instance-attribute
¶
Users in the guild.
channels: list[ChannelModel]
instance-attribute
¶
Channels in the guild.
threads: list[ChannelModel]
instance-attribute
¶
All active threads in the guild that are viewable.
unavailable: Optional[bool]
instance-attribute
¶
True if the guild is unavailable due to an outage.
id: int
instance-attribute
¶
ID of the guild.
name: str
instance-attribute
¶
Dispatch name of event.
icon: str
instance-attribute
¶
Image hash of the guild's icon.
splash: str
instance-attribute
¶
Image hash of the guild's splash.
owner: Optional[bool]
instance-attribute
¶
If the member is the owner.
owner_id: int
instance-attribute
¶
OD of the owner of the guild.
roles: list[RoleModel]
instance-attribute
¶
Roles in the guild.
emojis: list[EmojiModel]
instance-attribute
¶
List of emojis registered in the guild.
mfa_level: int
instance-attribute
¶
Required MFA level of the guild.
application_id: int
instance-attribute
¶
ID of the application if the guild is created by a bot.
system_channel_id: int
instance-attribute
¶
Channel ID where system messages go (e.g., welcome messages, boost events).
system_channel_flags: int
instance-attribute
¶
System channel flags.
rules_channel_id: int
instance-attribute
¶
Channel ID where rules are posted.
max_members: Optional[int]
instance-attribute
¶
Maximum member capacity for the guild.
description: str
instance-attribute
¶
Description of the guild.
banner: str
instance-attribute
¶
Image hash of the guild's banner.
preferred_locale: str
instance-attribute
¶
Preferred locale of the guild.
public_updates_channel_id: int
instance-attribute
¶
Channel ID of announcement or public updates.
approximate_member_count: int
instance-attribute
¶
Approximate number of members in the guild.
nsfw_level: int
instance-attribute
¶
NSFW level of the guild.
safety_alerts_channel_id: int
instance-attribute
¶
Channel ID for safety alerts.
raw: dict
instance-attribute
¶
Event's raw JSON payload. NOT A DATACLASS.
to_dict
¶
Recursively turns the dataclass into a dictionary and drops empty fields.
Returns:
-
dict–serialized dataclasss
GuildUpdateEvent
dataclass
¶
Received when a guild has been edited.
id: int
instance-attribute
¶
ID of the guild.
name: str
instance-attribute
¶
Name of the guild.
icon: str
instance-attribute
¶
Image hash of the guild's icon.
description: str
instance-attribute
¶
Description of the guild.
banner: str
instance-attribute
¶
Image hash of the guild's banner.
joined_at: str
instance-attribute
¶
ISO8601 timestamp of when app joined the guild.
large: bool
instance-attribute
¶
If the guild is considered large.
member_count: int
instance-attribute
¶
Total number of members in the guild.
raw: dict
instance-attribute
¶
Event's raw JSON payload. NOT A DATACLASS.
to_dict
¶
Recursively turns the dataclass into a dictionary and drops empty fields.
Returns:
-
dict–serialized dataclasss
GuildDeleteEvent
dataclass
¶
Bases: Event, UnavailableGuildModel
Received when the bot has left a guild or the guild was deleted.
id: int
instance-attribute
¶
ID of the associated guild.
unavailable: bool
instance-attribute
¶
If the guild is offline.
name: str
instance-attribute
¶
Dispatch name of event.
raw: dict
instance-attribute
¶
Event's raw JSON payload. NOT A DATACLASS.
to_dict
¶
Recursively turns the dataclass into a dictionary and drops empty fields.
Returns:
-
dict–serialized dataclasss
GuildBanAddEvent
dataclass
¶
Received when a user is banned from a guild.
guild_id: int
instance-attribute
¶
ID of the guild in which the ban took place.
user: UserModel
instance-attribute
¶
The user who was banned.
name: str
instance-attribute
¶
Dispatch name of event.
raw: dict
instance-attribute
¶
Event's raw JSON payload. NOT A DATACLASS.
to_dict
¶
Recursively turns the dataclass into a dictionary and drops empty fields.
Returns:
-
dict–serialized dataclasss
GuildBanRemoveEvent
dataclass
¶
Received when a user is unbanned from a guild.
guild_id: int
instance-attribute
¶
ID of the guild in which the ban took place.
user: UserModel
instance-attribute
¶
The user who was banned.
name: str
instance-attribute
¶
Dispatch name of event.
raw: dict
instance-attribute
¶
Event's raw JSON payload. NOT A DATACLASS.
to_dict
¶
Recursively turns the dataclass into a dictionary and drops empty fields.
Returns:
-
dict–serialized dataclasss
GuildEmojisUpdateEvent
dataclass
¶
Received when a guild updates their emojis.
guild_id: int
instance-attribute
¶
ID of the guild.
emojis: list[EmojiModel]
instance-attribute
¶
Complete set of guild emojis with changes.
name: str
instance-attribute
¶
Dispatch name of event.
raw: dict
instance-attribute
¶
Event's raw JSON payload. NOT A DATACLASS.
to_dict
¶
Recursively turns the dataclass into a dictionary and drops empty fields.
Returns:
-
dict–serialized dataclasss
GuildStickersUpdateEvent
dataclass
¶
Received when a guild's stickers have been updated.
guild_id: int
instance-attribute
¶
ID of the guild.
stickers: list[StickerModel]
instance-attribute
¶
List of the guild's stickers.
name: str
instance-attribute
¶
Dispatch name of event.
raw: dict
instance-attribute
¶
Event's raw JSON payload. NOT A DATACLASS.
to_dict
¶
Recursively turns the dataclass into a dictionary and drops empty fields.
Returns:
-
dict–serialized dataclasss