(allowed_mentions)
parse_allowed_mentionsIf allowed_mentions
is passed as None
, then returns a dict
, what will cause all mentions to be disabled.
If passed as an iterable
, then it's elements will be checked. They can be either type str
(any value from ('everyone', 'users', 'roles')
), UserBase
, Role
-s.
Passing everyone
will allow the message to mention @everyone
(permissions can overwrite this behaviour).
Passing 'users'
will allow the message to mention all the users, meanwhile passing UserBase
-s. allow to mentioned the respective users. Using users
and UserBase
-s. is mutually exclusive, and the wrapper will register only users
to avoid getting DiscordException
.
'roles'
and Role
-s. follow the same rules as 'users'
and the UserBase
-s.
By passing '!replied_user'
you can disable mentioning the replied user, or by passing 'replied_user'
you can re-enable mentioning the replied user.
Parameter | Type | Description |
---|---|---|
allowed_mentions |
| Which user or role can the message ping (or everyone). |
Returns
allowed_mentions : dict
of (str
, object
) items
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.