diff --git a/litecord/blueprints/guilds.py b/litecord/blueprints/guilds.py index ebdca11..c4675b8 100644 --- a/litecord/blueprints/guilds.py +++ b/litecord/blueprints/guilds.py @@ -286,17 +286,17 @@ async def _update_guild(guild_id): if 'icon' in j: await _guild_update_icon( - 'guild', guild_id, j['splash'], size=(128, 128)) + 'guild', guild_id, j['icon'], size=(128, 128)) - if 'splash' in j: + # small guild to work with to_update() + guild = await app.storage.get_guild(guild_id) + + if to_update(j, guild, 'splash'): if not await app.storage.has_feature(guild_id, 'INVITE_SPLASH'): raise BadRequest('guild does not have INVITE_SPLASH feature') await _guild_update_icon('splash', guild_id, j['splash']) - # small guild to work with to_update() - guild = await app.storage.get_guild(guild_id) - if to_update(j, guild, 'banner'): if not await app.storage.has_feature(guild_id, 'VERIFIED'): raise BadRequest('guild is not verified') diff --git a/litecord/schemas.py b/litecord/schemas.py index 6796ed8..c52cf8f 100644 --- a/litecord/schemas.py +++ b/litecord/schemas.py @@ -280,11 +280,11 @@ GUILD_UPDATE = { 'region': {'type': 'voice_region', 'required': False, 'nullable': True}, 'icon': {'type': 'b64_icon', 'required': False, 'nullable': True}, - 'splash': {'type': 'b64_icon', 'required': False, 'nullable': True}, # TODO: does splash also respect when its just a string pointing to the # hash, just like in USER_UPDATE.avatar? 'banner': {'type': 'string', 'required': False, 'nullable': True}, + 'splash': {'type': 'string', 'required': False, 'nullable': True}, 'description': { 'type': 'string', 'required': False,