Potentially fix no-discord

This commit is contained in:
augustin64 2024-04-10 12:15:14 +02:00
parent 52e88f81b9
commit f566b2eeda
3 changed files with 10 additions and 5 deletions

View File

@ -50,9 +50,14 @@ class Config:
""" """
self.discord = DiscordConfig() self.discord = DiscordConfig()
self.discord.avatar_url = settings["avatarlink"] self.discord.avatar_url = settings["avatarlink"]
self.discord.wh_link = discord[config[args.config]["discord"]]["errorsL"]
if self.discord.wh_link != "": if (
"discord" in config[args.config]
and config[args.config]["discord"] in discord
and "errorsL" in discord[config[args.config]["discord"]]
and discord[config[args.config]["discord"]]["errorsL"] != ""
):
self.discord.wh_link = discord[config[args.config]["discord"]]["errorsL"]
self.discord.wh = Webhook.from_url(self.discord.wh_link, adapter=RequestsWebhookAdapter()) self.discord.wh = Webhook.from_url(self.discord.wh_link, adapter=RequestsWebhookAdapter())
else: else:
self.discord.wh = FakeWebHook() self.discord.wh = FakeWebHook()

View File

@ -9,6 +9,6 @@ class DiscordConfig:
class FakeWebHook: class FakeWebHook:
def send(self, *args): def send(self, *args, **kwargs):
debug(f"Used a webhook call without webhook url with {args}") debug(f"Used a webhook call without webhook url with {args} {kwargs}")

View File

@ -1 +1 @@
v6.8.44 v6.8.45