Thijs Profile picture
building random projects • prev intern @discord
Aug 25, 2022 8 tweets 4 min read
Here's how a 5-line change dropped Truth or Dare Bot's CPU usage from 50-130% to 5%.

You heard it right, 5% cpu for a bot in 600,000 servers. A graph showing discord-interactions compared to discord-ver Truth or Dare uses HTTP Interactions, a method for running bots where Discord sends you a POST request when a command is run, and you respond how the bot should respond.

The bot is, essentially, a web server (fastify) allowing for great speed and performance.