Skip to content

Commit

Permalink
post-bot: Add support group links to post msg
Browse files Browse the repository at this point in the history
Signed-off-by: anoosragh69 <[email protected]>
  • Loading branch information
anoosragh69 committed Jun 10, 2024
1 parent 546c18b commit 666fc49
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/scripts/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ def get_info(id):
"size": str(required['size']),
"maintainer": maintainer,
"version" : required['version'],
'name' : name,
"name" : name,
"brand" : brand,
"ota" : ota,
"flash" : flash,
"time" : required['datetime'],
"filename" : required['filename'],
"id" : required['id'],
"romtype" : required['romtype'],
"support" : required['support'],
"url" : required['url'],
"updater" : required['updater']
}
Expand Down Expand Up @@ -167,6 +168,12 @@ def banner():
else:
print("ayo code died")

def support_chat(info):
if info:
return f"<a href=\"https://t.me/{info}/\">📲 Support Chat</a>" + "\n\n"
else:
return "\n"

# Prepare in the format needed
def cook_content(information):
message = ""
Expand All @@ -176,7 +183,8 @@ def cook_content(information):
"👤 " + "by " + str(information["maintainer"]) + "\n\n" + \
"ℹ️ " + "Version : " + str(information['version']) + "\n" +\
"📆 " + "Date: " + str(datetime.date.today()).replace("-", "/") + "\n" + \
"⬇️ " + "<a href=\"https://projectsakura.me/download/#/\">Download</a>" + "" + "\n\n" + \
"⬇️ " + "<a href=\"https://projectsakura.me/download/#/\">Download</a>" + "" + "\n" + \
f"{support_chat(information['support'])}" + \
bold(information['ota'], "") + "\n" + \
bold(information['flash'], "") + "\n\n" + \
"#" + str(information['device']) + " | #projectsakura" + "\n" + \
Expand Down

0 comments on commit 666fc49

Please sign in to comment.