From 54152735434e562712e6712616b5ec3253f2d646 Mon Sep 17 00:00:00 2001 From: Frisk Date: Sun, 18 Nov 2018 13:09:55 +0100 Subject: [PATCH] Probably fixes #36, added version info on startup --- rcgcdw.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rcgcdw.py b/rcgcdw.py index 920f2c7..05487b8 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -39,7 +39,8 @@ logging.info("Current settings: {settings}".format(settings=settings)) lang = gettext.translation('rcgcdw', localedir='locale', languages=[settings["lang"]]) lang.install() ngettext = lang.ngettext - +version = "1.5" +print("RcGcDw version {} is starting...".format(version)) class MWError(Exception): pass @@ -97,9 +98,12 @@ def safe_read(request, *keys): def send_to_discord_webhook(data): + header = settings["header"] + if "content" not in data: + header['Content-Type'] = 'application/json' try: result = requests.post(settings["webhookURL"], data=data, - headers={**{'Content-Type': 'application/json'}, **settings["header"]}, timeout=10) + headers=header, timeout=10) except requests.exceptions.Timeout: logging.warning("Timeouted while sending data to the webhook.") return 3