Port TiV changes applied to voice channels to stage channels (#6109)

This commit is contained in:
Jakub Kuczys
2023-05-03 01:05:44 +02:00
committed by GitHub
parent f1439a37c8
commit 2fe251ecf3
28 changed files with 213 additions and 95 deletions

View File

@@ -76,7 +76,11 @@ class Cleanup(commands.Cog):
async def get_messages_for_deletion(
*,
channel: Union[
discord.TextChannel, discord.VoiceChannel, discord.DMChannel, discord.Thread
discord.TextChannel,
discord.VoiceChannel,
discord.StageChannel,
discord.DMChannel,
discord.Thread,
],
number: Optional[int] = None,
check: Callable[[discord.Message], bool] = lambda x: True,
@@ -132,7 +136,11 @@ class Cleanup(commands.Cog):
self,
num: int,
channel: Union[
discord.TextChannel, discord.VoiceChannel, discord.DMChannel, discord.Thread
discord.TextChannel,
discord.VoiceChannel,
discord.StageChannel,
discord.DMChannel,
discord.Thread,
],
*,
subtract_invoking: bool = False,
@@ -153,7 +161,9 @@ class Cleanup(commands.Cog):
@staticmethod
async def get_message_from_reference(
channel: Union[discord.TextChannel, discord.VoiceChannel, discord.Thread],
channel: Union[
discord.TextChannel, discord.VoiceChannel, discord.StageChannel, discord.Thread
],
reference: discord.MessageReference,
) -> Optional[discord.Message]:
message = None