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, UnavailableGuild
Received when the bot has left a guild or the guild was deleted.
id: int
instance-attribute
¶
unavailable: bool
instance-attribute
¶
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
GuildMemberAddEvent
dataclass
¶
Bases: Event, GuildMemberModel
Received when a member joins a guild the bot is in.
Warning
Requires privileged GUILD_MEMBERS intent.
guild_id: int
instance-attribute
¶
ID of the guild.
roles: list[int]
instance-attribute
¶
List of roles registered to the guild member.
user: UserModel
instance-attribute
¶
User data associated with the guild member.
nick: str
instance-attribute
¶
Server nickname of the guild member.
avatar: str
instance-attribute
¶
Server avatar hash of the guild mmeber.
joined_at: str
instance-attribute
¶
ISO8601 timestamp of when the guild member joined server.
deaf: bool
instance-attribute
¶
If the member is deaf in a VC (input).
mute: bool
instance-attribute
¶
If the member is muted in VC (output).
permissions: Optional[int]
instance-attribute
¶
Total permissions of the member in the channel, including overwrites,
returned when in the interaction object. [INT_LIMIT]
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
GuildMemberUpdateEvent
dataclass
¶
Received when a guild member is updated.
Warning
Requires privileged GUILD_MEMBERS intent.
guild_id: int
instance-attribute
¶
ID of the guild.
roles: list[int]
instance-attribute
¶
List of user's roles (their IDs).
user: UserModel
instance-attribute
¶
The User object.
avatar: str
instance-attribute
¶
Guild avatar hash.
banner: str
instance-attribute
¶
Guild banner hash.
joined_at: str
instance-attribute
¶
When the user joined the guild
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
GuildMemberRemoveEvent
dataclass
¶
Received when a member leaves or is kicked/banned from a guild the bot is in.
Warning
Requires privileged GUILD_MEMBERS intent.
guild_id: int
instance-attribute
¶
ID of the guild.
user: UserModel
instance-attribute
¶
User object of the user leaving the guild.
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