Skip to content

Commit bffa7bd

Browse files
Lumabotspre-commit-ci[bot]Paillat-dev
authored
fix: add missing type checking for primary guild member, changelog and docs for incident data) (#2968)
* missing docs and CHANGELOG * style(pre-commit): auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Paillat <[email protected]>
1 parent 5a97fea commit bffa7bd

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ These changes are available on the `master` branch, but have not yet been releas
3232
`ui.MentionableSelect`, and `ui.ChannelSelect`.
3333
- Added `ui.FileUpload` for modals and the `FileUpload` component.
3434
([#2938](https://github.com/Pycord-Development/pycord/pull/2938))
35+
- Added support for Guild Incidents via `Guild.incidents_data` and
36+
`Guild.modify_incident_actions()`.
37+
([#2955](https://github.com/Pycord-Development/pycord/pull/2955))
3538

3639
### Changed
3740

discord/guild.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ class Guild(Hashable):
251251
with ``with_counts=True``.
252252
253253
.. versionadded:: 2.0
254+
255+
incidents_data: Optional[:class:`IncidentsData`]
256+
The incidents data for the guild.
257+
258+
.. versionadded:: 2.7
254259
"""
255260

256261
__slots__ = (

discord/member.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from .flags import MemberFlags
4444
from .object import Object
4545
from .permissions import Permissions
46+
from .primary_guild import PrimaryGuild
4647
from .user import BaseUser, User, _UserTag
4748
from .utils import MISSING
4849

@@ -311,6 +312,7 @@ class Member(discord.abc.Messageable, _UserTag):
311312
accent_color: Colour | None
312313
accent_colour: Colour | None
313314
communication_disabled_until: datetime.datetime | None
315+
primary_guild: PrimaryGuild | None
314316

315317
def __init__(
316318
self, *, data: MemberWithUserPayload, guild: Guild, state: ConnectionState
@@ -449,7 +451,8 @@ def _presence_update(
449451
) -> tuple[User, User] | None:
450452
self.activities = tuple(map(create_activity, data["activities"]))
451453
self._client_status = {
452-
sys.intern(key): sys.intern(value) for key, value in data.get("client_status", {}).items() # type: ignore
454+
sys.intern(key): sys.intern(value)
455+
for key, value in data.get("client_status", {}).items() # type: ignore
453456
}
454457
self._client_status[None] = sys.intern(data["status"])
455458

0 commit comments

Comments
 (0)