From f50b57ff91a8ad861c0bdee112883bd22891f9a1 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Tue, 8 Jan 2019 09:14:59 +0000 Subject: [PATCH] Revert to bot message if webhook failed to create SOMEHOW --- webapp/titanembeds/blueprints/api/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index 365191e..c57e8d8 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -171,7 +171,10 @@ def get_channel_webhook_url(guild_id, channel_id): "token": webhook["token"] } webhook = discord_api.create_webhook(channel_id, name) - return webhook["content"] + if webhook and "content" in webhook: + return webhook["content"] + else: + return None def get_all_users(guild_id): users = redisqueue.list_guild_members(guild_id)