Skip to content

Fix multi-part emoji parsing and API rate limit issues

Compare
Choose a tag to compare
@Mimickal Mimickal released this 22 Apr 12:13
· 46 commits to master since this release
c5bc194

Fixes some issues that were identified almost immediately upon pushing v2.0.0 live on the verified bot account.

Features:

  • Print when the bot starts. This helps show that the process is at least running, even if the bot can't log in.
  • Database location is now configurable. Use: "database_file": "path/to/your/file.sqlite3"
  • Log file location is now configurable. Use: "log_file": "path/to/your/logfile.log"
  • Bot is now a little more helpful if running a command without proper config. It will print a sample config file and tell you where to put it.

Fixes

  • Fix multi-part emoji matching. With the power of new logging, I saw people were failing to set up reactions with emojis like 1️⃣ and 🕴️. These should work now.
  • Remove GUILD_MEMBERS intent. We don't actually need it and it's a privleged intent, so verified bots need to qualify for it, which we don't (probably).
  • Disable message pre-fetch. This was added to stop the bot from dropping reaction events when it first restarts, but the cost is too great.
    • Despite message IDs being unique across all of Discord, you must know what channel they are in to query them. Channel ID isn't something we store, so this routine essentially had to ask every channel in every server if they contained a message matching the ID in the database. This is very hard on the API for bots in multiple servers, which causes the bot to get pretty much instantly rate limited, preventing it from actually doing anything. Naturally, I fired off all of those events at once, in a Promise.all(), on bot startup.
      I have no idea what I was thinking when I wrote this. Don't do crack.
      If for whatever reasons you still want this functionality, add this to your config: "enable_precache": true