Skip to content

Commit

Permalink
SOFA-dev-meeting: post as a file
Browse files Browse the repository at this point in the history
  • Loading branch information
hugtalbot committed Nov 7, 2024
1 parent a6f0f3b commit fc76458
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions SOFA-dev-meeting/SOFA-dev-meeting-template.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
discord_token = os.environ['DISCORD_WEBHOOK_URL']

def postOnDiscord(message):
payload = {
'content' : message,
'username' : 'SOFA dev meeting template',
'flags' : 4,
}
response = requests.post(discord_token, json=payload)
response = requests.post(discord_token, files={"file": open("SOFA-dev-meeting.md", "rb")})
print("Status: "+str(response.status_code)+"\nReason: "+str(response.reason)+"\nText: "+str(response.text))
return

Expand All @@ -28,22 +23,25 @@ def main(argv):
dateToday = today.strftime("%d/%m/%Y")

message="# "+str(dateToday)+"\n### News\n- \n\n### Technical discussions"
postOnDiscord(message)

message = list_topics_to_be_discussed("sofa")
postOnDiscord(message)
output = list_topics_to_be_discussed("sofa")
message = message + output

postOnDiscord("### PR review")
message = message + "### PR review"
for arg in argv[1:]:
message = list_to_review_pr(arg)
postOnDiscord(message+"\n")
output = list_to_review_pr(arg)
message = message + output +"\n"

postOnDiscord("### PR merged within the week")
message = message + "### PR merged within the week"
for arg in argv[1:]:
message = list_merged_pr(arg)
postOnDiscord(message+"\n")
output = list_merged_pr(arg)
message = message + output +"\n"

message = message + "\n---\n"

with open("SOFA-dev-meeting.md", "w") as f:
f.write(message)

postOnDiscord("\n---\n")

if __name__ == "__main__":
main(sys.argv)

0 comments on commit fc76458

Please sign in to comment.