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'))
|
SETTINGS = yaml.safe_load(open('../ShipmentNotifierSettings.yaml'))
|
||||||
|
|
||||||
def sendDiscordNotification(*args, settings=SETTINGS):
|
def sendDiscordNotification(*args, settings=SETTINGS):
|
||||||
|
now = datetime.now()
|
||||||
|
currentTime = now.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
newLine = '\n'
|
newLine = '\n'
|
||||||
|
|
||||||
shipmentNotification = requests.post(
|
shipmentNotification = requests.post(
|
||||||
SETTINGS['DISCORD_WEBHOOK'],
|
SETTINGS['DISCORD_WEBHOOK'],
|
||||||
json = {
|
json = {
|
||||||
@ -20,6 +23,9 @@ def sendDiscordNotification(*args, settings=SETTINGS):
|
|||||||
"title": ":package: New Inbound Shipment Detected :package:",
|
"title": ":package: New Inbound Shipment Detected :package:",
|
||||||
"url": f"https://sellercentral.amazon.co.uk/fba/sendtoamazon?wf={args[0]}",
|
"url": f"https://sellercentral.amazon.co.uk/fba/sendtoamazon?wf={args[0]}",
|
||||||
"color": 4886754,
|
"color": 4886754,
|
||||||
|
"footer": {
|
||||||
|
"text": f"ShipmentNotifier ({args[0]}) • {currentTime}"
|
||||||
|
},
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "Shipment Information",
|
"name": "Shipment Information",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user