From 750df7ba8aa2b4653d538d3e66380e5d20ce6e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BD=C3=A1=C4=8Dek?= Date: Tue, 12 Apr 2022 15:02:43 +0200 Subject: [PATCH] discord implementation --- tmgdsp.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tmgdsp.py b/tmgdsp.py index e031efa..5ebc20a 100644 --- a/tmgdsp.py +++ b/tmgdsp.py @@ -2,6 +2,12 @@ import csv from datetime import datetime import sys import os +from discord_webhook import DiscordWebhook + + +webhook = DiscordWebhook( + url='https://discordapp.com/api/webhooks/744608404848246926/FwwWUNmuWsCetFDBOcA1trCx6nSflI0yX3f9BNh7-oB5a2VYSLl882di23XK2TNWwQxP', + username="billing vfgdsp") dirpath = "." FILE = [filename for filename in os.listdir(dirpath) if filename.startswith("TMGDSP_")] @@ -202,7 +208,10 @@ with open('output_TMGDSP_'+ext_date_from_filaname, 'w') as f: csvfile.close() +with open('output_TMGDSP_'+ext_date_from_filaname, "rb") as f: + webhook.add_file(file=f.read(), filename='output_TMGDSP_'+ext_date_from_filaname) +response = webhook.execute()