From 30da1159e1ae38370bbd6c57a3faec4d5d026f3e Mon Sep 17 00:00:00 2001 From: Wasi Master <63045920+wasi-master@users.noreply.github.com> Date: Tue, 31 Aug 2021 11:04:09 +0600 Subject: [PATCH] Fix documentation for VoiceChannel.create_party --- discord/channel.py | 48 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 9b4eeee7..d741015c 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2071,7 +2071,50 @@ class PartialMessageable(discord.abc.Messageable, Hashable): return PartialMessage(channel=self, id=message_id) class Party: - """Represents a party in a voice channel.""" + """Represents a party in a voice channel. + + .. container:: operations + + .. describe:: x == y + + Checks if two party are equal. + + .. describe:: x != y + + Checks if two party are not equal. + + .. describe:: hash(x) + + Returns the party hash. + + .. describe:: str(x) + + Returns the party URL. + + Attributes + ----------- + code: :class:`str` + The URL fragment used for the party. + uses: :class:`int` + How many times the invite has been used. + max_uses: :class:`int` + How many times the invite can be used. + A value of ``0`` indicates that it has unlimited uses. + max_age: :class:`int` + How long before the party expires in seconds. + A value of ``0`` indicates that it doesn't expire. + temporary: :class:`bool` + Indicates that the invite grants temporary membership. + If ``True``, members who joined via this invite will be kicked upon disconnect. + created_at: :class:`datetime.datetime` + An aware UTC datetime object denoting the time the invite was created. + + Note + ---- + Parties are still in BETA so there are some limitations. + Currently this BETA feature is only supported on web and updated PC app versions of Discord and is not supported on mobile. + First someone has to to click the blue link itself and not the join button, then everyone else can click the join button normally. + """ __slots__ = ('code', 'uses', 'max_uses', 'max_age', 'temporary', 'created_at') @@ -2090,6 +2133,9 @@ class Party: def __str__(self): return f'https://discord.gg/{self.code}' + def __hash__(self) -> int: + return hash(self.code) + def __eq__(self, other): return isinstance(other, Party) and self.code == other.code