mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Allow introspection and setting of global allowed mention configuration
This commit is contained in:
parent
481b335f2d
commit
730d79d60a
@ -42,6 +42,7 @@ from .guild import Guild
|
|||||||
from .channel import _channel_factory
|
from .channel import _channel_factory
|
||||||
from .enums import ChannelType
|
from .enums import ChannelType
|
||||||
from .member import Member
|
from .member import Member
|
||||||
|
from .mentions import AllowedMentions
|
||||||
from .errors import *
|
from .errors import *
|
||||||
from .enums import Status, VoiceRegion
|
from .enums import Status, VoiceRegion
|
||||||
from .gateway import *
|
from .gateway import *
|
||||||
@ -665,6 +666,23 @@ class Client:
|
|||||||
else:
|
else:
|
||||||
raise TypeError('activity must derive from BaseActivity.')
|
raise TypeError('activity must derive from BaseActivity.')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mentions(self):
|
||||||
|
"""Optional[:class:`AllowedMentions`]: The allowed mention configuration.
|
||||||
|
|
||||||
|
.. versionadded:: 1.4
|
||||||
|
"""
|
||||||
|
return self._connection.mentions
|
||||||
|
|
||||||
|
@mentions.setter
|
||||||
|
def mentions(self, value):
|
||||||
|
if value is None:
|
||||||
|
self._connection.mentions = value
|
||||||
|
elif isinstance(value, AllowedMentions):
|
||||||
|
self._connection.mentions = value
|
||||||
|
else:
|
||||||
|
raise TypeError('mentions must be AllowedMentions not {0.__class__!r}'.format(value))
|
||||||
|
|
||||||
# helpers/getters
|
# helpers/getters
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user