diff options
| author | khazhyk <[email protected]> | 2016-10-27 20:32:14 -0700 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-11-03 04:39:45 -0400 |
| commit | 4d87b2f8176883a7f962844e8d6ddd90e9714c54 (patch) | |
| tree | e4937044e9d6599c42865be137d91a1d9ca3ae10 /discord/message.py | |
| parent | Add support for reactions. (diff) | |
| download | discord.py-4d87b2f8176883a7f962844e8d6ddd90e9714c54.tar.xz discord.py-4d87b2f8176883a7f962844e8d6ddd90e9714c54.zip | |
Inject full Emoji to Reaction if we have it.
Reaction objects with custom Emoji are partial. If we know of this Emoji
(can find it on this client) then inject it. Otherwise, leave it as a
hollow Emoji. We can still react with a hollow Emoji, but can't get other
metadata about it.
Diffstat (limited to 'discord/message.py')
| -rw-r--r-- | discord/message.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/discord/message.py b/discord/message.py index d2bdf87e..e6e2fdd1 100644 --- a/discord/message.py +++ b/discord/message.py @@ -115,6 +115,9 @@ class Message: '_system_content', 'reactions' ] def __init__(self, **kwargs): + self.reactions = kwargs.pop('reactions') + for reaction in self.reactions: + reaction.message = self self._update(**kwargs) def _update(self, **data): @@ -138,7 +141,6 @@ class Message: self._handle_upgrades(data.get('channel_id')) self._handle_mentions(data.get('mentions', []), data.get('mention_roles', [])) self._handle_call(data.get('call')) - self.reactions = [Reaction(message=self, **reaction) for reaction in data.get('reactions', [])] # clear the cached properties cached = filter(lambda attr: attr[0] == '_', self.__slots__) |