Including change to add footer to Discord notifications
This commit is contained in:
parent
5dd3a06864
commit
574e25f236
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user