HvZBot is a Discord bot that tracks the state of HvZ events at UC Davis.
The database tracks:
- Player roles
- Zombie tags
- Mod permissions
- Whether a zombie is hidden or not (OZs (original zombies) when introduced play like humans until they are exposed).
Gameplay features:
- Hidden zombies may access the Human channel, but when exposed, lose viewing permissions immediately.
- There is a leaderboard command, which shows which Zombies have the most tagged. Hidden zombies do not appear on the LB.
- A list of all players
- Total player accounts, with the real totals (meaning that hidden zombies are counted as zombies here).
State updates:
whocommand reveals a player's name and publicly known role using their Discord tag.assignallows mods to change a player's rolehide/ 'expose' allow OZs to be added and exposed.tagallows players themselves to tag themselves (selftagging is only used for Humans to change their roles when tagged) and each other.
I use Heroku and MongoDB Altas (cloud-hosted noSQL database), to host the Davis HVZ bot. There are ample resources for making a Discord bot using these tools. When testing, I utilize .env to fetch the important keys (make sure this is never found on your GitHub repositories!).
The .env contains:
DISCORD_TOKEN=[found in the Discord Developer portal]
MONGODB_SRV=[found on the Atlas site]
PREFIX=[prefix your bot uses; my choice was "-"]
To start the bot all that is needeed to clone and type:
node main.js
For Heroku setup, only a worker dyno is required. They unfortunately no longer carry free dynos, so this will cost money. Hosting is fairly straightforward:
- Enter the .env keys in the settings
- Connect a GitHub repository
- Add a
worker node main.jsdyno under Deploy.
- Achievements
- Mission-dependent features, such as allowing players to unlock bot features by successfully completing missions.