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

@@ -649,7 +649,7 @@ class Case:
@classmethod
async def from_json(
cls,
mod_channel: Union[discord.TextChannel, discord.VoiceChannel],
mod_channel: Union[discord.TextChannel, discord.VoiceChannel, discord.StageChannel],
bot: Red,
case_number: int,
data: dict,
@@ -659,7 +659,7 @@ class Case:
Parameters
----------
mod_channel: `discord.TextChannel` or `discord.VoiceChannel`
mod_channel: `discord.TextChannel` or `discord.VoiceChannel`, `discord.StageChannel`
The mod log channel for the guild
bot: Red
The bot's instance. Needed to get the target user
@@ -1252,7 +1252,7 @@ async def register_casetypes(new_types: List[dict]) -> List[CaseType]:
async def get_modlog_channel(
guild: discord.Guild,
) -> Union[discord.TextChannel, discord.VoiceChannel]:
) -> Union[discord.TextChannel, discord.VoiceChannel, discord.StageChannel]:
"""
Get the current modlog channel.
@@ -1263,7 +1263,7 @@ async def get_modlog_channel(
Returns
-------
`discord.TextChannel` or `discord.VoiceChannel`
`discord.TextChannel`, `discord.VoiceChannel`, or `discord.StageChannel`
The channel object representing the modlog channel.
Raises
@@ -1283,7 +1283,8 @@ async def get_modlog_channel(
async def set_modlog_channel(
guild: discord.Guild, channel: Union[discord.TextChannel, discord.VoiceChannel, None]
guild: discord.Guild,
channel: Union[discord.TextChannel, discord.VoiceChannel, discord.StageChannel, None],
) -> bool:
"""
Changes the modlog channel
@@ -1292,7 +1293,7 @@ async def set_modlog_channel(
----------
guild: `discord.Guild`
The guild to set a mod log channel for
channel: `discord.TextChannel`, `discord.VoiceChannel`, or `None`
channel: `discord.TextChannel`, `discord.VoiceChannel`, `discord.StageChannel`, or `None`
The channel to be set as modlog channel
Returns