AllowedMentionProxy
Proxy class to interact with allowed mentions.
Attributes
int
Whether everyone mention is enabled.
int
Whether replied user can be mentioned.
int
Whether all role is enabled.
int
Whether all user is enabled.
None | list<int>
The enabled roles by the proxy.
The enabled users by the proxy.
Properties
allow_everyone
A get-set-del property to enable or disable everyone mentions.
Accepts and returns bool
-s.
allow_replied_user
A get-set-del property to enable or disable replied user mention.
Accepts and returns None
and bool
-s.
allow_roles
A get-set-del property to enable or disable role mentions.
Accepts and returns bool
-s.
allow_users
A get-set-del property to enable or disable user mentions.
Accepts and returns bool
-s.
allowed_roles
A get-set-del property to enable or disable specific role mentions.
Accepts and returns None
or a list
, set
or tuple
of Role
-s.
allowed_users
A get-set-del property to enable or disable specific user mentions.
Accepts and returns None
or a list
, set
or tuple
of UserBase
-s.
Methods
(...)
__new__Parses allowed mentions
Parameter | Type | Optional | Description |
---|---|---|---|
*allowed_mentions | Which user or role can the message ping (or everyone). |
Raises
TypeError
If allowed_mentions
contains an element of invalid type.
ValueError
If allowed_mentions
contains en element of correct type, but an invalid value.
()
copyCopies the allowed mention proxy.
Returns
new : instance<type<self>>
(data)
from_dataCreates a new allowed mention proxy from the given data.
Parameter | Type | Description |
---|---|---|
data |
| Allowed mention data. |
Returns
self : instance<cls>
The created allowed mention proxy.
()
to_dataConverts the allowed mention proxy to json serializable object.
Returns
data : dict<str, object> items
(other)
updateUpdates the allowed mentions with the given value.
Parameter | Type | Description |
---|---|---|
other |
| Which user or role can the message ping (or everyone). |
Returns
self : instance<cls>
Raises
TypeError
If other
contains an element of invalid type.
ValueError
If other
contains en element of correct type, but an invalid value.
(other)
_create_from_variousCreates an allowed mention proxy instance from other object.
Parameter | Type | Description |
---|---|---|
other |
| The other instance to create allowed mention proxy from. |
Returns
self : instance<cls>
(self, other)
_subtractReturns an allowed mentions proxy, without elements found in other.
This is a classmethod.
Parameter | Type | Description |
---|---|---|
self |
| The allowed mention proxy to subtract the other from. |
other |
| The allowed mention proxy to subtract. |
Returns
new : instance<type<self>>
()
__add__Returns the union of the two allowed mention proxy.
()
__and__Returns the intersection of the two allowed mention proxy.
()
__eq__Returns whether the two allowed mention proxies are equal.
()
__getattr__Drops a rich attribute error.
()
__hash__Returns the allowed mention proxy's hash value.
()
__iter__Iterates back the values which with a same allowed mention proxy can be created.
This method is an iterable generator.
Yields
allowed_mentions : str
, UserBase
, Role
Which user or role can the message ping (or everyone).
()
__or__Returns the union of the two allowed mention proxy.
()
__radd__Returns the union of the two allowed mention proxy.
()
__rand__Returns the intersection of the two allowed mention proxy.
()
__repr__Returns the allowed mention proxy's representation.
()
__ror__Returns the union of the two allowed mention proxy.
()
__rsub__Returns an allowed mentions proxy, without elements found in self.
()
__rxor__Returns the symmetric difference of the two allowed mention proxy.
()
__sub__Returns an allowed mentions proxy, without elements found in other.
()
__xor__Returns the symmetric difference of the two allowed mention proxy.