diff options
| author | Saphielle Akiyama <[email protected]> | 2020-09-04 14:43:44 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-04 08:43:44 -0400 |
| commit | 33fb13043cc11453f4c91661ee92367f3db6549a (patch) | |
| tree | 1ebdce4487ad369ff16cd19b522d89cbba59eb01 | |
| parent | Add COMMUNITY to Guild.features (diff) | |
| download | discord.py-33fb13043cc11453f4c91661ee92367f3db6549a.tar.xz discord.py-33fb13043cc11453f4c91661ee92367f3db6549a.zip | |
Classmethods all and none for AllowedMentions
| -rw-r--r-- | discord/mentions.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/discord/mentions.py b/discord/mentions.py index a2ae86ec..73c9b500 100644 --- a/discord/mentions.py +++ b/discord/mentions.py @@ -68,6 +68,22 @@ class AllowedMentions: self.users = users self.roles = roles + @classmethod + def all(cls): + """A factory method that returns a :class:`AllowedMentions` with all fields explicitly set to ``True`` + + .. versionadded:: 1.5 + """ + return cls(everyone=True, users=True, roles=True) + + @classmethod + def none(cls): + """A factory method that returns a :class:`AllowedMentions` with all fields set to ``False`` + + .. versionadded:: 1.5 + """ + return cls(everyone=False, users=False, roles=False) + def to_dict(self): parse = [] data = {} |