AGRF's Favorite Bot, but Better!
Holocorp Overview is a custom Discord bot written for the AGRF Discord server. Having started as a simple interface for displaying the API status in a friendly format, the project grew to be a useful tool for several other applications, and has now been re-written and open-sourced.
- Real-time API status listing:
- Displays the player count of the entire backend;
- Displays ongoing lobbies in WipEout HD and WipEout Pulse, including all the information available in-game and more!
- Customization options available for the lobby listing;
- Backend status reporting - see at a glance if Thallium+Beat is down or under maintenance, with staff being able to set arbitrary reasons in the status message (
/status <reason>); - Randomization tools for event generation:
- Ability to generate a full list of weekly events with a single command (for ZGR Weekly Time Trials,
/generate_events); - Ability to generate a track or a list of tracks with customization of the track pool (
/gimme_a_track);
- Ability to generate a full list of weekly events with a single command (for ZGR Weekly Time Trials,
- Two chatbot capability implementations (
/reply_control):- Dumb replies - get random phrases from a pool or rig the game by setting the next reply;
- LLM-powered replies (OpenAI interface implementation), with a powerful and robust databank system planned for rich and token-efficient lore knowledge!
Configuration data and resources are located in the external directory:
external
├── config.json
├── llm_resources
│ ├── example_messages.json
│ ├── system_message.md
├── message_templates
│ ├── event_gen_template.md
│ ├── ping_reply_list.md
│ ├── status_maintenance.md
│ ├── status_maintenance_with_reason.md
│ ├── status_offline.md
│ ├── status_offline_with_reason.md
│ ├── status_online.md
│ ├── status_standby.md
│ └── status_standby_with_reason.md
└── secrets
├── credentials.txt
└── oai_credentials.txt
config.jsoncontains the bot's configuration options. If it is not present on startup, it will be created using the default values defined inio_handler->configInitial(class) and execution will be stopped;llm_resourcescontains the system message and the example messages used by the LLM in the LLM replies chatbot mode.system_message.mddoesn't require special formatting and is treated as a plain text file;example_messages.jsonmust follow the correct structure (an example of which is included in the respective file in this repository);message_templatescontains various templates for the bot's output:ping_reply_list.mdis the random reply pool used by the dumb reply chatbot mode. Messages are separated using|||for newline support.status_*.mdare files used by the bot to display the backend status.!PLAYERCOUNTand!LOBBYLISTINGkeywords are supported bystatus_online.mdand will be replaced with the respective values when displayed.status_*_with_reason.mdare files used by the bot when a status reason is specified by staff. It supports the!REASONkeyword which will be replaced with the specified reason when displayed. Each status has awith_reasonvariant, except forstatus_online.md.event_gen_template.mdis the template used for ZGR Weekly Time Trial event list generation. It supports numerous keywords that are replaced with their respective values:!PING: <@ZGR Tournaments> Discord role ID as specified byconfig.json->zgrRolePing;!YEAR: current year;!WEEK: current week;!DEADLINE: time left until the end of the current week- Note: all time-related keywords use the host system's timezone;
!TRACK2048: a random track from WipEout 2048's track roster.!SHIP2048: a random ship from WipEout 2048's ship roster.!CLASS2048: a random speed class available in WipEout 2048.!TRACKHD: a random track from WipEout HD's track roster, excluding Zone-specific tracks.!ZONEHD: a random track from WipEout HD's track roster, including Zone-specific tracks.!SHIPHD: a random ship from WipEout HD's ship roster.!CLASSHD: a random speed class available in WipEout HD.- Notes:
- Each keyword will be replaced by a unique random value (e.g. "!ZONEHD !ZONEHD" = "Syncopia Mallavol");
- Each keyword may only be used the maximum of 24 times;
- Keywords not specified here or encountered after exceeding the maximum use count will be left intact.
secretscontains various API keys and client tokens. Files must contain just the secret with no newlines. Specific file names are requested by the program at runtime. In the current implementation, the program requests:credentials.txt, which contains the Discord client token (must be present);oai_credentials.txt, which contains the OpenAI API key (if not present, LLM features will be disabled.)
$ git clone https://github.com/Antigravity-Racing-Foundation/Holocorp-Rewrite.git;- Provide the required
secrets(see Configuration ->secrets); - Run
$ python ./holocorp.py; - Containerize to taste (Podman is used by the AGRF but instructions won't be provided in this document.)
Not really, since this bot has been purpose-built for the AGRF Discord server's needs. This repository exists mostly for educational purposes only. However, you are free to reuse code from here as per this repository's license, open issues and submit pull requests.