17 lines
886 B
Python
17 lines
886 B
Python
from discord_webhook import DiscordWebhook
|
|
from bathook import bathook
|
|
|
|
webhookURL = "https://discordapp.com/api/webhooks/742784012640190565/NBhtbWpDdgMZPx7uCXO8Ofw-o8Lez0V17EBGIvYv7FTIeTENK24GHNL3krUbYnOOIJ63"
|
|
maxCharPerMessage = 1994
|
|
|
|
bathook = bathook("/etc/bacula/scripts/webhooks/ChrisProEliteMail.md", "nextcloud")
|
|
|
|
for message_part in bathook.get_formatted_message(): # For every message part in the truncated output, run this loop
|
|
webhook = DiscordWebhook(url=webhookURL, username="Snowsune's Bacula Daemon") # Attach the message
|
|
webhook.add_embed(bathook.get_discord_embed())
|
|
response = webhook.execute() # Hit send
|
|
#message_part = "```" + message_part + "```" # Encapsulate the messsage
|
|
#print(message_part)
|
|
#webhook = DiscordWebhook(url=webhookURL, content=message_part) # Attach the message
|
|
#response = webhook.execute() # Hit send
|