Browse Source

Guard against AttributeErrors when clearing cached slot cache.

pull/140/merge
Rapptz 9 years ago
parent
commit
e64787a415
  1. 17
      discord/message.py

17
discord/message.py

@ -117,9 +117,20 @@ class Message:
self._handle_mentions(data.get('mentions', []))
# clear the cached slot cache
del self._raw_mentions
del self._raw_channel_mentions
del self._clean_content
try:
del self._raw_mentions
except AttributeError:
pass
try:
del self._raw_channel_mentions
except AttributeError:
pass
try:
del self._clean_content
except AttributeError:
pass
def _handle_mentions(self, mentions):
self.mentions = []

Loading…
Cancel
Save