Add guild property to DMChannel, GroupChannel, and PartialMessageable

This improves generic duck typing programming by allowing narrowing
the types by just checking for a None guild attribute.
This commit is contained in:
Rapptz
2022-05-03 10:55:29 -04:00
parent 8699d2139a
commit c22b6dc2cd
2 changed files with 27 additions and 1 deletions

View File

@@ -825,7 +825,8 @@ class Client:
The optional guild ID to create a partial messageable for.
This is not required to actually send messages, but it does allow the
:meth:`PartialMessageable.jump_url` property to form a well formed URL.
:meth:`PartialMessageable.jump_url` and :attr:`PartialMessageable.guild`
properties to function properly.
type: Optional[:class:`.ChannelType`]
The underlying channel type for the partial messageable.