From 457b8e49f7b486bdfa66439326cd3ba0dadccf99 Mon Sep 17 00:00:00 2001 From: hugtalbot Date: Thu, 7 Nov 2024 23:31:49 +0100 Subject: [PATCH] SOFA-dev-meeting: post as a file (2) --- SOFA-dev-meeting/SOFA-dev-meeting-template.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SOFA-dev-meeting/SOFA-dev-meeting-template.py b/SOFA-dev-meeting/SOFA-dev-meeting-template.py index f2f9201..754193c 100644 --- a/SOFA-dev-meeting/SOFA-dev-meeting-template.py +++ b/SOFA-dev-meeting/SOFA-dev-meeting-template.py @@ -9,7 +9,8 @@ discord_token = os.environ['DISCORD_WEBHOOK_URL'] def postOnDiscord(): - response = requests.post(discord_token, files={"file": open("SOFA-dev-meeting.md", "rb")}) + files = {'upload_file': open('SOFA-dev-meeting.md','rb')} + response = requests.post(discord_token, files) print("Status: "+str(response.status_code)+"\nReason: "+str(response.reason)+"\nText: "+str(response.text)) return @@ -22,17 +23,17 @@ def main(argv): today = date.today() dateToday = today.strftime("%d/%m/%Y") - message="# "+str(dateToday)+"\n### News\n- \n\n### Technical discussions" + message="# "+str(dateToday)+"\n### News\n- \n\n### Technical discussions\n" output = list_topics_to_be_discussed("sofa") - message = message + output + message = message + output + "\n" - message = message + "### PR review" + message = message + "### PR review\n" for arg in argv[1:]: output = list_to_review_pr(arg) message = message + output +"\n" - message = message + "### PR merged within the week" + message = message + "### PR merged within the week\n" for arg in argv[1:]: output = list_merged_pr(arg) message = message + output +"\n"