mirror of https://gitlab.com/litecord/litecord.git
guilds: handle when j.icon is not present when creating guild
This commit is contained in:
parent
c71a75dd3d
commit
27a7c7e8ef
|
|
@ -128,7 +128,11 @@ async def create_guild():
|
||||||
|
|
||||||
guild_id = get_snowflake()
|
guild_id = get_snowflake()
|
||||||
|
|
||||||
|
if 'icon' in j:
|
||||||
image = await put_guild_icon(guild_id, j['icon'])
|
image = await put_guild_icon(guild_id, j['icon'])
|
||||||
|
image = image.icon_hash
|
||||||
|
else:
|
||||||
|
image = None
|
||||||
|
|
||||||
await app.db.execute(
|
await app.db.execute(
|
||||||
"""
|
"""
|
||||||
|
|
@ -136,7 +140,7 @@ async def create_guild():
|
||||||
verification_level, default_message_notifications,
|
verification_level, default_message_notifications,
|
||||||
explicit_content_filter)
|
explicit_content_filter)
|
||||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
||||||
""", guild_id, j['name'], j['region'], image.icon_hash, user_id,
|
""", guild_id, j['name'], j['region'], image, user_id,
|
||||||
j.get('verification_level', 0),
|
j.get('verification_level', 0),
|
||||||
j.get('default_message_notifications', 0),
|
j.get('default_message_notifications', 0),
|
||||||
j.get('explicit_content_filter', 0))
|
j.get('explicit_content_filter', 0))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue