You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

1h 38m 21s logged

Devlog 2:

I finally finished adding the core message tracking features! I made some slash commands that let users track the top chatters over different time periods.


I created the /last-hour, /last-day, and /last-week commands. I used Python’s datetime module to calculate an exact time period and then look back through the channel history to count up the messages. I also added a defer() function to each command so the bot can safely process the data without timing out or breaking.


When implementing the /all-time command, I realized that downloading every single message ever sent could easily crash the bot. To fix this, I built a custom warning button using. Now, the bot sends a warning message with a Confirm & Run button, and it will only start the process if a user explicitly clicks it.


I ran into a frustrating issue with Git where my .env file kept getting included in my commits even though it was listed in my .gitignore. I learned that because Git tracked the file early on, it was ignoring the ignore rules. I used the terminal to untrack it and was able to keep it ignored.


Next I will be working on moving the bot away from API scraping and into local storage. I will be working on the following thiings:

  • Setting up a SQLite database within the project.
  • Logging and counting messages in real-time as they are sent.
  • Rewriting the leaderboard commands to pull from the database instead of loading history from discord APIs.

Thank you for reading my 2nd devlog!

0
2

Comments 0

No comments yet. Be the first!