diff options
| author | Rapptz <[email protected]> | 2020-11-27 00:32:08 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-11-27 00:32:08 -0500 |
| commit | bd6ab93348fbceee498ac11d5403d0c89c50ca0c (patch) | |
| tree | c638501eb2f9382e45242f49b793454c5843986f /discord/abc.py | |
| parent | Implement discord.Message.reply (diff) | |
| download | discord.py-bd6ab93348fbceee498ac11d5403d0c89c50ca0c.tar.xz discord.py-bd6ab93348fbceee498ac11d5403d0c89c50ca0c.zip | |
Code cleanup involving enums and message replies
Diffstat (limited to 'discord/abc.py')
| -rw-r--r-- | discord/abc.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/discord/abc.py b/discord/abc.py index 4968ce1b..559dbde8 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -39,7 +39,6 @@ from .invite import Invite from .file import File from .voice_client import VoiceClient, VoiceProtocol from . import utils -from .message_reference import _MessageType, MessageReference class _Undefined: def __repr__(self): @@ -897,15 +896,13 @@ class Messageable(metaclass=abc.ABCMeta): if mention_author is not None: allowed_mentions = allowed_mentions or {} - allowed_mentions['replied_user'] = mention_author + allowed_mentions['replied_user'] = bool(mention_author) if reference is not None: - if isinstance(reference, _MessageType): - if not isinstance(reference, MessageReference): - reference = reference.to_reference() - reference = reference.to_dict() - else: - raise InvalidArgument('reference parameter must be Message or MessageReference') + try: + reference = reference.to_message_reference_dict() + except AttributeError: + raise InvalidArgument('reference parameter must be Message or MessageReference') from None if file is not None and files is not None: raise InvalidArgument('cannot pass both file and files parameter to send()') |