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

Top Chatter - a discord bot

  • 2 Devlogs
  • 3 Total hours

A discord bot that shows who has the most messages in a discord server

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!

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!

Replying to @muhamm38

0
2
Open comments for this post

1h 14m 15s logged

Devlog 1:

I was able to get the discord bot online and running! Set up the basic framework using Python and the discord.py library. I got it connected to discord and online and made it print a confirmation message to terminal when it’s online.


I also used canva to make some custom art for the discord profile picture and the banner to make it look more professional and give it some personality.


I ran into some SSL certificate verification errors when running the bot which was annoying to debug and fix. I used Github Copilot to help me debug and solve the issues and I figured out that I had to point Python to the certifi certificate bundle. Once I restarted and ran it again, the bot connected successfully.


Next I will be working on the core features of the bot which are:

  • A command that lets you see who has the most messages in a server within the last day.
  • A command for most within the last week.
  • A command for most messages all time in the server.

These are the core basic features I plan to implement, I have other ideas like commands to see who spent time in vc (voice chat) in the same pattern as the messages commands and more things like that.

Thank you for reading my 1st devlog!

Devlog 1:

I was able to get the discord bot online and running! Set up the basic framework using Python and the discord.py library. I got it connected to discord and online and made it print a confirmation message to terminal when it’s online.


I also used canva to make some custom art for the discord profile picture and the banner to make it look more professional and give it some personality.


I ran into some SSL certificate verification errors when running the bot which was annoying to debug and fix. I used Github Copilot to help me debug and solve the issues and I figured out that I had to point Python to the certifi certificate bundle. Once I restarted and ran it again, the bot connected successfully.


Next I will be working on the core features of the bot which are:

  • A command that lets you see who has the most messages in a server within the last day.
  • A command for most within the last week.
  • A command for most messages all time in the server.

These are the core basic features I plan to implement, I have other ideas like commands to see who spent time in vc (voice chat) in the same pattern as the messages commands and more things like that.

Thank you for reading my 1st devlog!

Replying to @muhamm38

0
2

Followers

Loading…