aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-01-08 07:24:56 -0500
committerRapptz <[email protected]>2017-01-08 07:24:56 -0500
commitd13df30e2aff83263b5defab3cece43f85bc42d0 (patch)
tree60e3b36ba2fee99ad1633454c48d431330c0933b
parent[commands] Add AutoShardedBot counterpart to AutoShardedClient. (diff)
downloaddiscord.py-d13df30e2aff83263b5defab3cece43f85bc42d0.tar.xz
discord.py-d13df30e2aff83263b5defab3cece43f85bc42d0.zip
Add ability to edit guild invite splashes.
-rw-r--r--discord/guild.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/discord/guild.py b/discord/guild.py
index dba9c6b9..90702fa9 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -441,6 +441,11 @@ class Guild(Hashable):
icon: bytes
A *bytes-like* object representing the icon. Only PNG/JPEG supported.
Could be ``None`` to denote removal of the icon.
+ splash: bytes
+ A *bytes-like* object representing the invite splash.
+ Only PNG/JPEG supported. Could be ``None`` to denote removing the
+ splash. Only available for partnered guilds with ``INVITE_SPLASH``
+ feature.
region: :class:`GuildRegion`
The new region for the guild's voice communication.
afk_channel: :class:`VoiceChannel`
@@ -475,7 +480,18 @@ class Guild(Hashable):
else:
icon = None
+ try:
+ splash_bytes = fields['splash']
+ except KeyError:
+ splash = self.splash
+ else:
+ if splash_bytes is not None:
+ splash = utils._bytes_to_base64_data(splash_bytes)
+ else:
+ splash = None
+
fields['icon'] = icon
+ fields['splash'] = splash
if 'afk_channel' in fields:
fields['afk_channel_id'] = fields['afk_channel'].id