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/client.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/client.py')
| -rw-r--r-- | discord/client.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/discord/client.py b/discord/client.py index ff247959..b1b87ca9 100644 --- a/discord/client.py +++ b/discord/client.py @@ -953,7 +953,7 @@ class Client: data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts) channel = self.get_channel(data.get('channel_id')) - message = Message(channel=channel, **data) + message = self.connection._create_message(channel=channel, **data) return message @asyncio.coroutine @@ -1035,7 +1035,7 @@ class Client: data = yield from self.http.send_file(channel_id, buffer, guild_id=guild_id, filename=filename, content=content, tts=tts) channel = self.get_channel(data.get('channel_id')) - message = Message(channel=channel, **data) + message = self.connection._create_message(channel=channel, **data) return message @asyncio.coroutine @@ -1234,7 +1234,7 @@ class Client: content = str(new_content) guild_id = channel.server.id if not getattr(channel, 'is_private', True) else None data = yield from self.http.edit_message(message.id, channel.id, content, guild_id=guild_id) - return Message(channel=channel, **data) + return self.connection._create_message(channel=channel, **data) @asyncio.coroutine def get_message(self, channel, id): @@ -1267,7 +1267,7 @@ class Client: """ data = yield from self.http.get_message(channel.id, id) - return Message(channel=channel, **data) + return self.connection._create_message(channel=channel, **data) @asyncio.coroutine def pin_message(self, message): @@ -1337,7 +1337,7 @@ class Client: """ data = yield from self.http.pins_from(channel.id) - return [Message(channel=channel, **m) for m in data] + return [self.connection._create_message(channel=channel, **m) for m in data] def _logs_from(self, channel, limit=100, before=None, after=None, around=None): """|coro| @@ -1418,7 +1418,7 @@ class Client: def generator(data): for message in data: - yield Message(channel=channel, **message) + yield self.connection._create_message(channel=channel, **message) result = [] while limit > 0: |