Browse Source
Classmethods all and none for AllowedMentions
pull/5793/head
Saphielle Akiyama
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
16 additions and
0 deletions
-
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 = {} |
|
|
|