Potentially fix no-discord
This commit is contained in:
parent
52e88f81b9
commit
f566b2eeda
|
@ -50,9 +50,14 @@ class Config:
|
|||
"""
|
||||
self.discord = DiscordConfig()
|
||||
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())
|
||||
else:
|
||||
self.discord.wh = FakeWebHook()
|
||||
|
|
|
@ -9,6 +9,6 @@ class DiscordConfig:
|
|||
|
||||
|
||||
class FakeWebHook:
|
||||
def send(self, *args):
|
||||
debug(f"Used a webhook call without webhook url with {args}")
|
||||
def send(self, *args, **kwargs):
|
||||
debug(f"Used a webhook call without webhook url with {args} {kwargs}")
|
||||
|
||||
|
|
Loading…
Reference in New Issue