Welcome to the details of how DaalBot works, from how certain features get their data to how the APIs and bot all communicate. To be clear all of this is simplifed, if you're looking to implement these yourself I would advise looking at the source code instead

The infrastructure

This is gonna be a bit of a long read, so grab a cup of tea NOT COFFEE and get ready to learn about how DaalBot works.

The server

DaalBot as of June 2025 runs on a single server, it is equipped with 8GB of RAM and a AMD EPYC processor (4 cores) running Ubuntu Server 20.04 LTS. The server is located in Quebec, Canada and is hosted by OVHcloud connected to a 300Mbps (dualway) connection. The server is running Node.js 18.16.0 and uses PM2 to manage the bot and API processes. We only have one IP address that the bot, and internal / public APIs use, instead of having multiple IPs we use subdomains to differentiate between the bot and APIs. In order to map these subdomains we use Nginx as a reverse proxy.

The bot

The bot mostly operates by itself, it is fully capable of running without the API, meaning that even if the API were to go down the bot would still be able to function. The only thing the bot needsto transmit data to the API is the data displayed on bot.daalbot.xyz.

The APIs

Internal

The internal API is used by the public API to communicate with the filesystem on the bots server, this comes from when the public API used to be hosted on a different server, but now that the public API is hosted on the same server as the bot, so this could be considered redundant, but it is still kept for backwards compatibility.

External

The public API is used by the dashboard and any applications that want to interact with it, because this isn't just public facing for our own sites but also for third party applications, if you want to learn more here's the API documentation. As for the actual details for how it works, refer to the source code.

Logging

Message Deletion Attribution

DaalBot uses discords audit log feature to determine who deleted a message, whenever a message is deleted, DaalBot will ask Discord for the latest entries in the audit log. For this example, we are going to say that the message was sent by Alice now if the audit log has an entry that says that Bob had deleted a message sent by Alice then DaalBot will attribute the deletion to Bob; however, if Alice or a bot had deleted it, Discord doesn't add a entry for it, so we instead just say that the message was deleted by "Alice or a bot".
To be clear, this is not a perfect system, theoretically if Bob deleted a message sent by Alice and then a bot or Alice deleted a message sent by Alice it would also be attributed to Bob, but that's why this note is here, There is no perfect way to find out who deleted a message, we're just taking a educated guess based on the data Discord provides us.