Skip to content

Commit

Permalink
assets: Update to new 9.2 bannerss
Browse files Browse the repository at this point in the history
- also add support to switch between banners on new posts

Signed-off-by: anoosragh69 <[email protected]>
  • Loading branch information
anoosragh69 committed Jun 9, 2024
1 parent 6336723 commit 7719755
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
Binary file removed .github/assets/banner.jpg
Binary file not shown.
Binary file added .github/assets/banner_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/banner_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/banner_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/scripts/banner.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
22 changes: 20 additions & 2 deletions .github/scripts/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,23 @@ def bold(text1, text2):
message = "<b>" + text1 + "</b>" + text2
return message

def banner():
with open(".github/scripts/banner.txt", "r+") as f:
b = int(f.read())
if b == 0:
f.seek(0)
f.write('1')
return "1"
elif b == 1:
f.seek(0)
f.write('2')
return "2"
elif b == 2:
f.seek(0)
f.write('0')
return "3"
else:
print("ayo code died")

# Prepare in the format needed
def cook_content(information):
Expand Down Expand Up @@ -188,7 +205,7 @@ def update_json(information):
old = read_old()

if len(get_diff(new, old)) == 0:
print("All Updated\nNothing to do\nExiting")
print("Al4 Updated\nNothing to do\nExiting")
exit()

print(get_diff(new, old))
Expand All @@ -197,9 +214,10 @@ def update_json(information):
for i in get_diff(new, old):
print(i)
info = get_info(i)
ban_n = banner()
bot.send_sticker(CHAT_ID, STICKER_ID)
#send_mes(cook_content(info))
send_photo(".github/assets/banner.jpg", cook_content(info))
send_photo(f".github/assets/banner_{ban_n}.jpg", cook_content(info))
if info["updater"]:
update_json(info)
commit_message = "Update new IDs and push OTA"
Expand Down

0 comments on commit 7719755

Please sign in to comment.