From 0fd4d57719ecef255061847267849e9477779fdf Mon Sep 17 00:00:00 2001 From: EdVraz <88881326+EdVraz@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:21:31 +0200 Subject: [PATCH 1/2] Update channel.py --- interactions/api/models/channel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interactions/api/models/channel.py b/interactions/api/models/channel.py index 363c2e159..d38b1628a 100644 --- a/interactions/api/models/channel.py +++ b/interactions/api/models/channel.py @@ -315,7 +315,7 @@ async def modify( :param topic?: The topic of that channel, defaults to the current value of the channel :type topic: Optional[str] :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel - :type bitrate Optional[int] + :type bitrate: Optional[int] :param user_limit?: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel :type user_limit: Optional[int] :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel @@ -724,10 +724,14 @@ async def purge( .. warning:: Calling this method can lead to rate-limits when purging higher amounts of messages. + .. code-block:: python + def check_pinned(message): return not message.pinned # This returns `True` only if the message is the message is not pinned await channel.purge(100, check=check_pinned) # This will delete the newest 100 messages that are not pinned in that channel + + :param amount: The amount of messages to delete :type amount: int :param check?: The function used to check if a message should be deleted. The message is only deleted if the check returns `True` From 0a25ca71ee0c7e7c9019188970d31c2eaa2bc0f4 Mon Sep 17 00:00:00 2001 From: EdVraz <88881326+EdVraz@users.noreply.github.com> Date: Sun, 24 Apr 2022 21:14:15 +0200 Subject: [PATCH 2/2] Update channel.py --- interactions/api/models/channel.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/interactions/api/models/channel.py b/interactions/api/models/channel.py index d38b1628a..458d49889 100644 --- a/interactions/api/models/channel.py +++ b/interactions/api/models/channel.py @@ -724,14 +724,12 @@ async def purge( .. warning:: Calling this method can lead to rate-limits when purging higher amounts of messages. - .. code-block:: python def check_pinned(message): return not message.pinned # This returns `True` only if the message is the message is not pinned await channel.purge(100, check=check_pinned) # This will delete the newest 100 messages that are not pinned in that channel - :param amount: The amount of messages to delete :type amount: int :param check?: The function used to check if a message should be deleted. The message is only deleted if the check returns `True`