Skip to content

Commit f5f01c8

Browse files
ref!: set GuildMember as a subclass of Member (#1023)
* ref!: set GuildMember as a subclass of Member * ci: correct from checks. * revert: add back original functions * ci: correct from checks. * fix: remove other branch git sorcery * ci: correct from checks. * fix: last github fix Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c1322db commit f5f01c8

File tree

1 file changed

+18
-24
lines changed
  • interactions/api/models

1 file changed

+18
-24
lines changed

interactions/api/models/gw.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -234,36 +234,30 @@ class GuildJoinRequest(DictSerializerMixin):
234234

235235

236236
@define()
237-
class GuildMember(ClientSerializerMixin):
237+
class GuildMember(Member):
238238
"""
239239
A class object representing the gateway events ``GUILD_MEMBER_ADD``, ``GUILD_MEMBER_UPDATE`` and ``GUILD_MEMBER_REMOVE``.
240240
241-
:ivar Snowflake guild_id: The guild ID of the event.
242-
:ivar Optional[List[Role]] roles?: The roles of the event.
243-
:ivar Optional[User] user?: The user of the event.
244-
:ivar Optional[str] nick?: The nickname of the user of the event.
245-
:ivar Optional[str] avatar?: The avatar URL of the user of the event.
246-
:ivar Optional[datetime] joined_at?: The time that the user of the event joined at.
247-
:ivar Optional[datetime] premium_since?: The time that the user of the event has since had "premium."
248-
:ivar Optional[bool] deaf?: Whether the member of the event is deafened or not.
249-
:ivar Optional[bool] mute?: Whether the member of the event is muted or not.
250-
:ivar Optional[bool] pending?: Whether the member of the event is still pending -- pass membership screening -- or not.
251-
:ivat Optional[datetime.isoformat] communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out.
241+
.. note::
242+
``pending`` and ``permissions`` only apply for members retroactively
243+
requiring to verify rules via. membership screening or lack permissions
244+
to speak.
245+
246+
:ivar Snowflake guild_id: The guild ID.
247+
:ivar User user: The user of the guild.
248+
:ivar str nick: The nickname of the member.
249+
:ivar Optional[str] avatar?: The hash containing the user's guild avatar, if applicable.
250+
:ivar List[int] roles: The list of roles of the member.
251+
:ivar datetime joined_at: The timestamp the member joined the guild at.
252+
:ivar datetime premium_since: The timestamp the member has been a server booster since.
253+
:ivar bool deaf: Whether the member is deafened.
254+
:ivar bool mute: Whether the member is muted.
255+
:ivar Optional[bool] pending?: Whether the member is pending to pass membership screening.
256+
:ivar Optional[Permissions] permissions?: Whether the member has permissions.
257+
:ivar Optional[str] communication_disabled_until?: How long until they're unmuted, if any.
252258
"""
253259

254260
guild_id: Snowflake = field(converter=Snowflake)
255-
roles: Optional[List[str]] = field(default=None)
256-
user: Optional[User] = field(converter=User, default=None, add_client=True)
257-
nick: Optional[str] = field(default=None)
258-
_avatar: Optional[str] = field(default=None, discord_name="avatar")
259-
joined_at: Optional[datetime] = field(converter=datetime.fromisoformat, default=None)
260-
premium_since: Optional[datetime] = field(converter=datetime.fromisoformat, default=None)
261-
deaf: Optional[bool] = field(default=None)
262-
mute: Optional[bool] = field(default=None)
263-
pending: Optional[bool] = field(default=None)
264-
communication_disabled_until: Optional[datetime.isoformat] = field(
265-
converter=datetime.fromisoformat, default=None
266-
)
267261

268262
def __str__(self) -> str:
269263
return self.name or ""

0 commit comments

Comments
 (0)