"""The MIT License (MIT)Copyright (c) 2021-present Pycord DevelopmentPermission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the "Software"),to deal in the Software without restriction, including without limitationthe rights to use, copy, modify, merge, publish, distribute, sublicense,and/or sell copies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERDEALINGS IN THE SOFTWARE."""fromtypingimportAnyfromtyping_extensionsimportSelf,overridefromdiscord.app.stateimportConnectionStatefromdiscord.automodimportAutoModRulefromdiscord.raw_modelsimportAutoModActionExecutionEventfrom..app.event_emitterimportEvent
[docs]classAutoModRuleCreate(Event):"""Called when an auto moderation rule is created. The bot must have :attr:`~Permissions.manage_guild` to receive this, and :attr:`Intents.auto_moderation_configuration` must be enabled. Attributes ---------- rule: :class:`AutoModRule` The newly created rule. """__event_name__:str="AUTO_MODERATION_RULE_CREATE"__slots__=("rule",)rule:AutoModRule@classmethod@overrideasyncdef__load__(cls,data:Any,state:ConnectionState)->Self:self=cls()self.rule=AutoModRule(state=state,data=data)returnself
[docs]classAutoModRuleUpdate(Event):"""Called when an auto moderation rule is updated. The bot must have :attr:`~Permissions.manage_guild` to receive this, and :attr:`Intents.auto_moderation_configuration` must be enabled. Attributes ---------- rule: :class:`AutoModRule` The updated rule. """__event_name__:str="AUTO_MODERATION_RULE_UPDATE"__slots__=("rule",)rule:AutoModRule@classmethod@overrideasyncdef__load__(cls,data:Any,state:ConnectionState)->Self:self=cls()self.rule=AutoModRule(state=state,data=data)returnself
[docs]classAutoModRuleDelete(Event):"""Called when an auto moderation rule is deleted. The bot must have :attr:`~Permissions.manage_guild` to receive this, and :attr:`Intents.auto_moderation_configuration` must be enabled. Attributes ---------- rule: :class:`AutoModRule` The deleted rule. """__event_name__:str="AUTO_MODERATION_RULE_DELETE"__slots__=("rule",)rule:AutoModRule@classmethod@overrideasyncdef__load__(cls,data:Any,state:ConnectionState)->Self:self=cls()self.rule=AutoModRule(state=state,data=data)returnself
[docs]classAutoModActionExecution(Event,AutoModActionExecutionEvent):"""Called when an auto moderation action is executed. The bot must have :attr:`~Permissions.manage_guild` to receive this, and :attr:`Intents.auto_moderation_execution` must be enabled. This event inherits from :class:`AutoModActionExecutionEvent`. """__event_name__:str="AUTO_MODERATION_ACTION_EXECUTION"@classmethod@overrideasyncdef__load__(cls,data:Any,state:ConnectionState)->Self:self=cls()event=awaitAutoModActionExecutionEvent.from_data(state,data)self.__dict__.update(event.__dict__)returnself