About Asphalt

Overview
Asphalt is a Discord bot that I currently run, it has gone through multiple complete rewrites in the following languages:

  • C#
  • Python
  • Java + Kotlin
  • Back to C#

The bot currently has 67 million active users in 125,000 unique servers

The bot is currently hosted off of a Debian dedicated server, with 24 cores, 32GB of RAM, a 2TB M.2 SSD and a 1Gbps dedicated line.

Backend
The backend of Asphalt uses the microservice architecture, we have the following microservices and tools:

  • API – this communicates with the bot via a local websocket connection
  • Webhook Dispatcher – when a user votes for Asphalt on a bot list, the notification will be sent here; at which point the microservice will parse the data and convert it into a recognised json format (meaning that I can add new voting sources without needing to change the expected formatting on the bot’s end)
  • Watchtower – this is a service that I made to monitor the status of the bot and either alert me when the bot goes down via text/voice call via Twilio or try and remedy the situation automatically
  • Audio Node Discovery – this is a service that monitors the audio nodes (responsible for playing audio to various discord servers) and places new audio players onto the least congested server in the closest region to the user (measured by latency to voice server)
  • SQL Server Database – This contains around 7.5 million records, including economy, command executions, error logs etc
  • B2 Backblaze – We use B2 Backblaze for our hourly database backups to ensure that, in the event of a database issue, we could recover a recent backup with minimal data loss. We also used Google Cloud Functions to allow the bot to fetch the token to log into Discord with, so that no tokens were hard coded into the bot
  • Staff Panel – Our support team are provided with a staff panel (written in C# + using WPF) which allows them to interact with the bot’s API, e.g. blocking people from using the bot, giving a user donator permissions etc.
  • Key Generator – This is a discontinued system (implemented into the main staff panel), which allowed support staff to generate item and donator keys

Leave a comment

Your email address will not be published. Required fields are marked *