4 Commits

Author SHA1 Message Date
Bhupesh Varshney
3feccf6755 Update aoc.yml 2025-01-10 00:17:12 +05:30
Bhupesh-V
101b529307 🐛 fix: handle case for no announcements 2024-12-31 22:06:21 +05:30
Bhupesh-V
e9a454fa5a I apologise, my bad 2024-12-06 21:19:53 +05:30
Bhupesh-V
345dc1016e use Annonymous user instead of None 2024-12-05 18:07:37 +05:30
3 changed files with 7 additions and 2 deletions

View File

@@ -1,9 +1,9 @@
name: AoC leaderboard
on:
schedule:
# schedule:
# Run every 24 hours at 00:00 UTC
- cron: "0 0 * * *"
# - cron: "0 0 * * *"
workflow_dispatch:
permissions:

View File

@@ -31,6 +31,10 @@ def format_leaderboard(data, num_players=100):
for i, member_data in enumerate(sorted_members[:num_players]):
# check for non-zero local_score
if member_data['local_score'] > 0:
# if member's name is null, use the member_id
if member_data['name'] == None:
member_data['name'] = f"Anonymous #{member_data['id']}"
leaderboard_stats += f"| {i + 1} | {member_data['name']} | {member_data['stars']} | {member_data['local_score']} |\n"
leaderboard_stats += f"\nUpdated every 24 hours"

View File

@@ -154,6 +154,7 @@ def create_community_roundup_post(
**Community Roundup is posted on the last day of each month. To explore a compilation of all interesting posts and community threads over time, [visit our wiki](https://www.reddit.com/r/developersIndia/wiki/community-threads/).**\n
The collection is curated by our volunteer team & is independent of the number of upvotes and comments (except for "I made This" posts). If you believe we may have overlooked any engaging posts or discussions, please share them with us via [modmail](https://reddit.com/message/compose?to=r/developersIndia&subject=Community%20Threads%20Collection%20Suggestion&message=Hey%20folks%2C%0A%0A%3Cpost%20link%3E).\n
"""
text = ""
if len(announcement_posts) > 0:
text = "## Announcements\n|Announcements from volunteer team|\n|--------|\n"