This integrates the system for skill leveling challenges (and slayer, and possibly collections), closes #19
Todo until mergable:
[x] Scheduler system
[x] Add a challenge to the scheduler
[x] Determine if challenge needs to update its state and gather data - "Tick"
[x] Update (advance/increment) challenge state on tick
[x] Update announcement message on tick
[x] Gather player stats on tick if needed
[x] Create leaderboard on tick if needed (Data shows: Leaderboard in embed can only show up to 15 players)
[x] Ability for admin/moderator to create challenges
[x] Set basic info (Type, start time, end time, name, pay-in, auto-accept, etc.)
[x] Create an announcement message, informing players about the challenge event
[x] Do this permission-based, so not everyone can create a challenge
[x] Players can join the challenge
[x] Check if there are challenges the player can join (Is there a OPEN challenge the player is not yet participating in?)
[x] Not yet participating check is not implemented until stress test (requires finished scheduler system & accepting players)
[x] Let the player choose with what profile they want to join
[x] Let the player choose what challenge they want to join
[x] Show player a preview of their entry and let them confirm
[x] Update the challenge object (Needed data: Discord ID, MC UUID, Profile UUID)
[x] Automatically confirm entry when Auto-Accept is on
[x] Update the announcement embed with new participants-count
[ ] Admins/Moderators can confirm the entry of a player when Auto-Accept is off
[x] List all players currently participating, filter by acception-state
[ ] Accept a player
[ ] Update the announcement embed with new participants-count
[ ] Update player info in challenge object, setting its state to CONFIRMED
[x] Event hooks
[x] On Bot stop, save all currently tracked challenge events
[x] On Bot start, load all challenge events found in ./data that need to be tracked again
[x] On Challenge status changing to DISCARD or ENDED, save this challenge into the challenge archive
[x] Un-Schedule the challenge
Testing this new feature
I did some manual testing (semi-automated unit tests, no integration tests)
Whole feature integration can only effectively being tested with live data. As Hypixel offers no fake-data API, this will ultimately needs testing in production. Booo!
Current Flaws
[x] When Bot reconnects without graceful stop before (Internet connection down, timeout, crash), the bot loses tracking of current events (THE CHALLENGE EVENT GETS DELETED!)
[x] Add a global variable "INITIAL_START" set to True, and inside on_read set it to False.
[x] Only reinstanciate hypixel_api and challenge_scheduler, when INITIAL_START is True.
[x] If tracked_challenges.json is not found in data/, do not reload challenges in on_ready()
Other features
Dynamic Bot response system
Bot should only respond with exactly one message to each command invoke. This implies a technique that passes a message object between called coroutines inside a command. This Release introduces such a system.
On stopping the bot, the current global bot state can be saved as a snapshot and loaded on next bot start, so no data loss.
This will come in handy on following updates that revamp the current (beta) dynamic voice channels
This integrates the system for skill leveling challenges (and slayer, and possibly collections), closes #19
Todo until mergable:
Testing this new feature
I did some manual testing (semi-automated unit tests, no integration tests) Whole feature integration can only effectively being tested with live data. As Hypixel offers no fake-data API, this will ultimately needs testing in production. Booo!
Current Flaws
Other features