Add automod types to audit log

This commit is contained in:
z03h
2022-07-07 16:30:03 -07:00
committed by GitHub
parent b88bdaf4c0
commit 04aeff660b
5 changed files with 70 additions and 19 deletions

View File

@ -66,7 +66,7 @@ class AutoModRuleAction:
type: :class:`AutoModRuleActionType`
The type of action to take.
channel_id: Optional[:class:`int`]
The ID of the channel to send the alert message to, if any.
The ID of the channel or thread to send the alert message to, if any.
duration: Optional[:class:`datetime.timedelta`]
The duration of the timeout to apply, if any.
Has a maximum of 28 days.
@ -463,7 +463,7 @@ class AutoModAction:
def channel(self) -> Optional[Union[GuildChannel, Thread]]:
"""Optional[Union[:class:`abc.GuildChannel`, :class:`Thread`]]: The channel this action was taken in."""
if self.channel_id:
return self.guild.get_channel(self.channel_id)
return self.guild.get_channel_or_thread(self.channel_id)
return None
@property