Skip to content

Commit 21d3fd9

Browse files
committed
Fix errors if random string is put as hook in conf
1 parent f7d0d6e commit 21d3fd9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

utils/webhooks.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
from . import config
66

77
http = httpx.Client()
8-
if config.get_available_webhook() != "": webhook = easy_discord_webhooks.Webhook(config.get_available_webhook())
9-
if config.get_updates_webhook() != "": updates_webhook = easy_discord_webhooks.Webhook(config.get_updates_webhook())
8+
try:
9+
if config.get_available_webhook() != "": webhook = easy_discord_webhooks.Webhook(config.get_available_webhook())
10+
except Exception as e:
11+
print(e)
12+
webhook = ""
13+
try:
14+
if config.get_updates_webhook() != "": updates_webhook = easy_discord_webhooks.Webhook(config.get_updates_webhook())
15+
except Exception as e:
16+
print(e)
17+
updates_webhook = ""
1018
if config.get_archives_webhook() != "": lists_webhooks = config.get_archives_webhook()
1119

1220
def send_available(name):

0 commit comments

Comments
 (0)