mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Add AutoModTrigger.__repr__
This commit is contained in:
parent
84767ef840
commit
cd6fd13a8f
@ -199,6 +199,14 @@ class AutoModTrigger:
|
|||||||
self.mention_limit: int = mention_limit if mention_limit is not None else 0
|
self.mention_limit: int = mention_limit if mention_limit is not None else 0
|
||||||
self.regex_patterns: List[str] = regex_patterns if regex_patterns is not None else []
|
self.regex_patterns: List[str] = regex_patterns if regex_patterns is not None else []
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
data = self.to_metadata_dict()
|
||||||
|
if data:
|
||||||
|
joined = ' '.join(f'{k}={v!r}' for k, v in data.items())
|
||||||
|
return f'<AutoModTrigger type={self.type} {joined}>'
|
||||||
|
|
||||||
|
return f'<AutoModTrigger type={self.type}>'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_data(cls, type: int, data: Optional[AutoModerationTriggerMetadataPayload]) -> Self:
|
def from_data(cls, type: int, data: Optional[AutoModerationTriggerMetadataPayload]) -> Self:
|
||||||
type_ = try_enum(AutoModRuleTriggerType, type)
|
type_ = try_enum(AutoModRuleTriggerType, type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user