Skip to content

Commit

Permalink
Allow introspection and setting of global allowed mention configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Apr 4, 2020
1 parent 481b335 commit 730d79d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from .channel import _channel_factory
from .enums import ChannelType
from .member import Member
from .mentions import AllowedMentions
from .errors import *
from .enums import Status, VoiceRegion
from .gateway import *
Expand Down Expand Up @@ -665,6 +666,23 @@ def activity(self, value):
else:
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

@property
Expand Down

0 comments on commit 730d79d

Please sign in to comment.