mirror of https://gitlab.com/litecord/litecord.git
guilds: add support for icon hash for j.splash
- guilds: fix guild icon being set to j.splash - schemas: handle splash being icon hash
This commit is contained in:
parent
5bfafa2a29
commit
5c0dfcc9b1
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue