Implement "partial" message events.

These are events that get triggered regardless of the state of the
message cache. Useful for getting data from before the bot was booted.
This commit is contained in:
Rapptz
2017-06-09 18:36:59 -04:00
parent 1be119cd45
commit d239cc2666
7 changed files with 178 additions and 26 deletions

View File

@ -237,9 +237,7 @@ def _get_as_snowflake(data, key):
except KeyError:
return None
else:
if value is None:
return value
return int(value)
return value and int(value)
def _get_mime_type_for_image(data):
if data.startswith(b'\x89\x50\x4E\x47\x0D\x0A\x1A\x0A'):