Including change to add footer to Discord notifications

This commit is contained in:
Dom 2024-09-01 18:17:14 +01:00
parent 5dd3a06864
commit 574e25f236

View File

@ -11,7 +11,10 @@ from ShipmentNotifierLogger import log
SETTINGS = yaml.safe_load(open('../ShipmentNotifierSettings.yaml'))
def sendDiscordNotification(*args, settings=SETTINGS):
now = datetime.now()
currentTime = now.strftime("%Y-%m-%d %H:%M:%S")
newLine = '\n'
shipmentNotification = requests.post(
SETTINGS['DISCORD_WEBHOOK'],
json = {
@ -20,6 +23,9 @@ def sendDiscordNotification(*args, settings=SETTINGS):
"title": ":package: New Inbound Shipment Detected :package:",
"url": f"https://sellercentral.amazon.co.uk/fba/sendtoamazon?wf={args[0]}",
"color": 4886754,
"footer": {
"text": f"ShipmentNotifier ({args[0]}) • {currentTime}"
},
"fields": [
{
"name": "Shipment Information",