Discord Boss Tracker

A discord bot for sharing the status of Black Desert Online bosses.

September 2, 2023 · 2y ago

View on GitHub

What is Discord Boss Tracker?

Discord Boss Tracker is a Discord bot for tracking bosses in Black Desert Online. Users with certain discord roles can call up bosses in a status channel, where all other users can view and update a given boss's health.

Boss Timers

World bosses in Black Desert spawn on a fixed schedule. The bot pulls this schedule from a Google Calendar which must be made when setting up this bot. Once the bot receives the schedule, it formats it using a Discord embed which it sends to a timers channel every minute.

By default, 5 minutes before a boss is scheduled to spawn, the bot will send a notification to all users telling them the boss is about to spawn. Then at spawn time, the bot will automatically call up the boss, allowing users to start updating its health. While the boss is alive, the timers embed will show it in a separate section labeled 'Active Bosses'.

A discord embed sent by a webhook called 'Timers'. The embed is split into five sections: Maintenance, Spawned Bosses, In Window, Window Closed, and World Boss Timers.

Field bosses work a little differently from world bosses in that they do not have a fixed spawn time. They instead have windows where they can spawn and not spawn. This is also tracked by the timers bot. The bot relies on users to call up these field bosses, so if it is not called up by the end of its window, the boss will show as late.

When set by a moderator the timers bot will show when the next scheduled game maintenance is. All field bosses will have their window times adjusted based on when maintenance ends.

See timersMessage.js

27/09/2023 Update

Timers will now show bosses even when their next spawn or window is unknown. They will be marked with a '??' in place of the countdown. This prevents blank messages from being sent when first setting up the bot. It also lets users know when a boss has been removed from the schedule.

A discord embed, this time split into two sections: Window Closed, and World Boss Timers. Next to each boss's name is text saying '?? until spawn'.

Boss Status Chart

When a boss is active, a status chart will appear showing the health of a given boss. This chart will be regenerated once every minute, or when a user updates the boss's health. The chart is made using Canvas and will change in size according to the number of channels in the database.

A chart for the field boss Katzvariak. The chart is divided into seven columns indicating a channel group, and six rows indicating a channel number. Some cells are different colors indicating the status of the boss on that channel: grey for 'DNS', blue for unknown, green for 100% health, yellow for 75% health, orange for 50% health, red for 25% health, and light grey for dead.

The bot uses an event listener to listen for new/edited messages and then parses through them to check for a status update. The flow works like this:

  1. Check if the message contains the phrase 'revive'. This is used by moderators to resend the chart for a boss that has already been cleared.
    • Loop through the boss list and see if the message matches a boss's alias regex.
    • If it matches and the boss is not active, restart the boss session.
  2. Match the message against a list of ignored words. If it matches, ignore the message.
  3. Check the message for a boss alias. (bheg, bh, mud, etc.) REGEX: katz?v?a?r?i?a?k?
  4. If the matched boss is a field boss, check for a channel alias. (kama2, b5, season 1, etc.) REGEX: b(?:a|al|ale|alen|aleno|alenos)?\s?2
    • If no channel is matched, remind the user to specify a channel.
  5. Check the message for health value. (100%, 70, dead, despawn, etc.)
  6. Set the boss's health and send the updated chart.

See handleMessages.js

Examples

A user has sent a message containing 'kama3 rn 100' and the bot responded with a new chart where the cell for the 'Kamasylvia 3' channel is now green with the text '100%' within.

This user's call passes all checks and the chart is updated.

  • kama3 matches channel Kamasylvia 3
  • rn matches boss Red Nose
  • 100 matches alive health regex
A user makes a bad call and the bot responds by asking them to specify a channel.

In this call, the user does not specify a channel. The user is reminded with a message that auto-deletes after 10 seconds.

A user makes the call 'kz 75' and the bot responds with a new chart. There is one cell indicating all channels that is now yellow and contains the text '75%'.

World bosses share health across all channels so a channel does not need to be specified.

Boss Clear Message

Once a boss has been cleared, a summary embed will be sent to the status channel which includes which servers the boss died, despawned, did not spawn, and was uncalled on. It will also display the time it took to clear the boss.

A field boss summary embed sent by the bot. At the top there is a time of text stating the boss's name and how long it took to clear. Below that there is a summary of which channels the boss was killed, despawned, did not spawn, and uncalled on. There is a footnote informing users that this boss was cleared by a moderator.

To prevent the chart from staying up forever, the bot will auto-clear a boss once it reaches its forceClearTime. The summary embed will show that the boss's window was adjusted based on the force despawn time.

A field boss summary embed similar to the one above. This time the footnote informs users that the boss was automatically cleared by the bot instead of by a moderator.

See Boss.clearBoss()

Adding More Channels

If more channels are added to Black Desert, they can be entered into the bot's database and will start showing in the boss chart. The new Rulupee channels have a higher ID in the database and thus appear at the end of the chart.

Added channels to the chart.

See canvas.js