Palantir Rebirth is the refactor of the Palantir Bot.
It consists of multiple components that can be deployed individually for scalability and maintainability (blah blah).
Palantir-Rebirth follows the new separation of business+data from application layer and uses toobeeh/Valmar as grpc backend.
The components are split to Core, Commands, Public and Lobbies modules.
GRPC clients for Valmar and ImageGen are installed from their NuGet packages.
For local development, the packages can be switched to a local version in the csproj files.
When pushing to the repository, the packages should be switched back to the NuGet version.
This is especially important to ensure nuget has the latest version of the packages.
Core contains features that are vital for the complete typo ecosystem, like dispatching drops, cleaning database, fetching patrons, and everything that happens on a scheduled basis.
Core should not be replicated; can be considered rather as a client and performs non-cpu-heavy things.
Tasks of core module (planned and implemented):
- Update patrons & boosters and write to user flags
- Dispatch drops (get online count, get active event, send drop request and calculate next timeout)
- Clear volatile data
- Initiate bubble traces
- Increment user bubbles in 10s interval
- Set online items
Commands is a class library and uses a DSharpPlus Bot to bring the functionality of the current Palantir Bot to Discord, using the gRPC backend. Commands are split into following categories. Checklist for implementation:
-
>sprite view [id]
/>sprite [id]
- View a sprite -
>sprite buy [id]
- Buy a sprite -
>sprite use [id] (slot)
- Use a sprite on a slot -
>sprite combo (...ids)
- Use a combo of sprites -
>sprite color [id] (color shift)
- Use a rainbow shift color on a sprite -
>sprite inventory
- View all bought sprites and total value -
>sprite list
- View a ranking of all sprites
-
>scene view [id]
/>scene [id]
- View a scene -
>scene buy [id]
- Buy a scene -
>scene use (id)
- Use a scene -
>scene inv
- View all bought scenes and the next scene price -
>scene list
- View a ranking of all sprites
-
>outfit
/>outfits list
- View all outfits -
>outfit save [name]
- Save the current sprite/scene/rainbow combo as outfit -
>outfit use [name]
- Use a saved outfit -
>outfit delete [name]
- Delete a saved outfit -
>outfit view [name]
- View details of a saved outfit
-
>event (id)
/>event view (id)
- View an event -
>event list
- Show all events -
>event gift [user] [amount] [eventId]
- Gift a user event drops of an event -
Removed>event redeem [amount] [sprite]
- Redeem event league credit for a sprite's event drop
-
>league (month) (year)
- View the league overview for a month -
>league board (month) (year)
- View the league board for a month -
>league rank (month) (year)
- View the own league stats for a month
-
>card
/>card view
- View the user card -
>card customize (headercolor) (lighttext) (darktext) (bgopacity) (headeropacity) (imgurid) (templateName)
- Customize the user card -
>patron gift (@user)
- Patronize a user or view/remove the patronized user -
>patron emoji (emoji)
- Set the patronemoji or view/remove the patronized user
-
>boost inv
- Show an overview of the user splits -
>boost (factor) (cooldown) (duration) (now)
- Start a new dropboost -
>boost rate
- Show the current droprate and the users current boosts -
>boost upgrade
- Upgrade one of the user's boosts (may also be in cooldown) -
>boost cooldown
- View a member's current split cooldowns
-
>award
/>awards inventory
- Show an overview of the user's given/received awards' -
>award gallery
- Show the gallery of received awards -
>award view [id]
- View an received award with image
-
>help (command)
- Show the help -
>about
- Show some infos/stats -
>calc [rank/bubbles] [amount]
- Calculate the time to reach a goal -
>leaderboard (bubbles / drops)
- View the server leaderboard of bubbles or drops -
>stat (day/week/month)
- View the bubble stat graph for month/week/day -
>inventory
- View the inventory of the user (no sprites/list) with stats of drops, bubbles, flags, current combo, patronemoji, splits
(not necessary for first release)
The public module is a simple bot wrapper around the commands module, to deploy the bot.
Anyone is able to add this bot to this server; the bot targets primary slash commands.
The Lobbies module is used to bring the lobbies feature to selected servers.
A number of instances of the lobby module is deployed; each instance claims a dedicated discord bot from a database (distinct token/id).
Patrons can claim the dedicated bots for their server.
The Lobbies instance watches their claimed bot, joins servers, and refreshes lobbies each 20s if they are set up.
Furthermore, it provides the command functionality via text commands.
Following graphic shows the schedule every instance is running on: