You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Get building on current Poetry and Python
* Update actions to latest versions for Node 24
* Update pyproject for Poetry 2
* I love the formatter
* Fixing up type issues
* Update icalendar and Pillow
Copy file name to clipboardExpand all lines: uqcsbot/advent.py
+27-47Lines changed: 27 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -64,9 +64,11 @@
64
64
member.times[day].get(2, MAXIMUM_TIME_FOR_STAR),
65
65
),
66
66
"Star 2 Time": lambdamember, day: (
67
-
member.times[day][2] -member.times[day][1]
68
-
if2inmember.times[day]
69
-
elseMAXIMUM_TIME_FOR_STAR,
67
+
(
68
+
member.times[day][2] -member.times[day][1]
69
+
if2inmember.times[day]
70
+
elseMAXIMUM_TIME_FOR_STAR
71
+
),
70
72
member.times[day].get(1, MAXIMUM_TIME_FOR_STAR),
71
73
),
72
74
"Star 1 & 2 Time": lambdamember, day: (
@@ -478,24 +480,19 @@ async def help_command(
478
480
"""
479
481
matchcommand:
480
482
caseNone:
481
-
awaitinteraction.response.send_message(
482
-
"""
483
+
awaitinteraction.response.send_message("""
483
484
[Advent of Code](https://adventofcode.com/) is a yearly coding competition that occurs during the first 12 days (used to be 25 days before year 2025) of december. Coding puzzles are released at 3pm AEST each day, with two stars available for each puzzle. You can spend as long as you like on each puzzle, but UQCS also has a private leaderboard with prizes on offer.
484
485
485
486
To join, go to <https://adventofcode.com/> and sign in. The UQCS private leaderboard join code is `989288-0ff5a98d`. To be eligible for prizes, you will also have to link your discord account. This can be done by using the `/advent register` command. Reach out to committee if you are having any issues.
486
487
487
488
For more help, you can use `/advent help <command name>` to get information about a specific command.
488
-
"""
489
-
)
489
+
""")
490
490
case"help":
491
-
awaitinteraction.response.send_message(
492
-
"""
491
+
awaitinteraction.response.send_message("""
493
492
`/advent help` is a help menu for all the Advent of Code commands. If you use `/advent help <command name>` you can see details of a particular command. Not much else to say here, try another command.
494
-
"""
495
-
)
493
+
""")
496
494
case"leaderboard":
497
-
awaitinteraction.response.send_message(
498
-
"""
495
+
awaitinteraction.response.send_message("""
499
496
`/advent leaderboard` displays a leaderboard for the Advent of Code challenges. There are two types of leaderboard: for a single day, and for the entire month. These are selected by either providing the `day` option or not. You can also display the leaderboard for a past year or another leaderboard (say another private leaderboard that you have).
500
497
501
498
There are 6 different sorting options, which do slightly different things depending on whether the leaderboard is for a single day or an entire month. The default sorting method changes on which type of leaderboard you want.
@@ -507,11 +504,9 @@ async def help_command(
507
504
`Global ` - This sorts by users global score. Note that this will only show users with global score. Note that this only works for year before 2025, as Advent of code remvoed global leaderboard for years after and including 2025.
508
505
509
506
You can also style the leaderboard (i.e. change the columns). The default style will change depending on whether the leaderboard is for a single-day or the entire month, and depending on the sorting method. Styles consist of a string, with each character representing a column. Use `/advent help leaderboard-style` to see the possoble characters.
510
-
"""
511
-
)
507
+
""")
512
508
case"leaderboard_style":
513
-
awaitinteraction.response.send_message(
514
-
"""
509
+
awaitinteraction.response.send_message("""
515
510
Not a command, but an option given to the command `/advent leaderboard` controlling the columns in the leaderboard. Each character in the given string represents a certain column. The possible characters are:
516
511
The characters in the string can be:
517
512
`# ` - Provides a column of the form "XXX)" telling the order for the given leaderboard
@@ -527,41 +522,29 @@ async def help_command(
527
522
`B ` - A progress bar of the stars each person has
528
523
`space` - A padding column of a single character
529
524
All other characters will be ignored.
530
-
"""
531
-
)
525
+
""")
532
526
case"register":
533
-
awaitinteraction.response.send_message(
534
-
"""
527
+
awaitinteraction.response.send_message("""
535
528
`/advent register` links an Advent of Code account and a discord user so that you are eligble for prizes. Each Advent of Code account and discord account can only be linked to one other account. Registrations persist across years. If you are having any issues with this, message committee to help.
536
-
"""
537
-
)
529
+
""")
538
530
case"register-force":
539
-
awaitinteraction.response.send_message(
540
-
"""
531
+
awaitinteraction.response.send_message("""
541
532
`/advent register-force` is an admin-only command to force a registration (i.e. create a registration between any Advent of Code account and Discord user). This can be used for moderation, if someone is having difficulties registering or if you want to register someone for a previous year. This command can break things (such as creating duplicate registrations), so be careful. Exactly one of `aoc_name` or `aoc_id` should be given. Also note that you need to use the Discord ID, not the discord username. If you have developer options enables on your account, this can be found by right clicking on the user and selecting `Copy User ID`.
542
-
"""
543
-
)
533
+
""")
544
534
case"unregister":
545
-
awaitinteraction.response.send_message(
546
-
"""
535
+
awaitinteraction.response.send_message("""
547
536
`/advent unregister` unlinks your discord account from the currently linked Advent of Code account. Message committee if you need any help.
548
-
"""
549
-
)
537
+
""")
550
538
case"unregister-force":
551
-
awaitinteraction.response.send_message(
552
-
"""
539
+
awaitinteraction.response.send_message("""
553
540
`/advent unregister-force` is an admin-only command that removes a registration from the database. This can be used as a moderation tool, to remove someone who has registered to an Advent of Code account that isn't there. Note that you need to use the Discord ID, not the discord username. If you have developer options enables on your account, this can be found by right clicking on the user and selecting `Copy User ID`.
554
-
"""
555
-
)
541
+
""")
556
542
case"previous-winners":
557
-
awaitinteraction.response.send_message(
558
-
"""
543
+
awaitinteraction.response.send_message("""
559
544
`/advent previous-winners` displays the previous winners for a particular year. Note that the records for year prior to 2022 may not be accurate, as the current system was not in use then.
560
-
"""
561
-
)
545
+
""")
562
546
case"new-winner":
563
-
awaitinteraction.response.send_message(
564
-
"""
547
+
awaitinteraction.response.send_message("""
565
548
`/advent add-winner` is an admin-only command that allows you to either manually or randomly select winners. Participants will only be eligible to win if they have completed at least one star within the given times. For manual selection, provide an Advent of Code user ID (note that this is not the same as their Advent of Code name), otherwise a random winner will be drawn.
566
549
567
550
The arguments for the command have a bit of nuance. They are as follow:
@@ -572,14 +555,11 @@ async def help_command(
572
555
`allow_repeat_winners ` - This allows participants to win multiple times from the same selection if `number_of_winners` is greater than 1. Note that regardless of this option, someone can win multiple times in a year, just not in a single selection.
573
556
`allow_unregistered_users` - This allows Advent of Code accounts that do not have a linked discord account to win. Note that it can be difficult to give out prizes to users that do not have a linked discord.
574
557
`year ` - The year the prize is for.
575
-
"""
576
-
)
558
+
""")
577
559
case"remove-winner":
578
-
awaitinteraction.response.send_message(
579
-
"""
560
+
awaitinteraction.response.send_message("""
580
561
`/advent remove-winner` is an admin-only command that removes a winner from the database. It uses the database ID (which is distinct from the Advent of code user ID and the Discord user ID). You can find these ids by running `/advent previous-winners show_ids:True`.
0 commit comments