Browse Source

Sandbox some events that didn't get sandboxed.

pull/3/head
Rapptz 10 years ago
parent
commit
b6ab4d54d3
  1. 4
      discord/client.py

4
discord/client.py

@ -228,14 +228,14 @@ class Client(object):
elif event == 'MESSAGE_CREATE':
channel = self.get_channel(data.get('channel_id'))
message = Message(channel=channel, **data)
self.events['on_message'](message)
self._invoke_event('on_message', message)
self.messages.append(message)
elif event == 'MESSAGE_DELETE':
channel = self.get_channel(data.get('channel_id'))
message_id = data.get('id')
found = self._get_message(message_id)
if found is not None:
self.events['on_message_delete'](found)
self._invoke_event('on_message_delete', found)
self.messages.remove(found)
elif event == 'MESSAGE_UPDATE':
older_message = self._get_message(data.get('id'))

Loading…
Cancel
Save