Skip to content

ajkeast/DiscordBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DiscordBot

Hey there! 👋 I'd like to introduce you to my Discord bot project that combines the power of AI with server management and analytics. What started as a simple chatbot has grown into something I'm really proud of - a full-featured assistant that helps manage our server, generates AI art, and even keeps track of our community games!

The AI Brain 🤖

ChatGPT Integration

The heart of this bot is its ability to have natural conversations using ChatGPT. I designed it with a fun twist - it talks like a chill, surfer bro who's always relaxed! This personality choice has made interactions with the bot not just helpful, but genuinely entertaining for our server members.

What makes it really special is how it can interact with real-world data. I implemented a function calling system that lets the bot do things like:

  • Check the current weather for any location
  • Tell you the time in different timezones
  • Post tweets (when it's feeling social!)
  • Search the web with Tavily API

Here's what it looks like in action: image

DALL·E 3 Art Studio

One of my favorite features is the AI art generation using DALL·E 3. Members can describe any image they imagine, and the bot brings it to life in stunning 1024x1024 resolution. I've added some smart features here too - like tracking usage and managing access to keep costs under control (those API calls aren't free, after all! 😅).

Check out some of the amazing art our community has created: image

Server Management & Analytics 📊

I'm a bit of a data nerd, so I wanted to know more about how our server was being used. That's why I built a comprehensive logging system that writes everything to a MySQL database hosted on AWS. This has turned into one of the most valuable parts of the project!

The Dashboard

All this data comes to life in our custom dashboard (https://peterdinklage.streamlit.app/). It's where you can see things like:

  • Who's been most active this month
  • Popular times for server activity
  • And my personal favorite - who's winning our daily games!

Here's what the dashboard looks like: image Screenshot 2023-03-04 at 5 39 41 PM

Behind the Scenes

The bot quietly keeps track of everything happening in the server. I've built commands that help manage:

  • Member information (_members)
  • Custom emoji usage (_emojis)
  • Channel management (_channels)

These commands help keep our server organized and give us insights into how it's growing over time.

Community Games 🎮

Remember that daily game I mentioned? It's become one of our server's most popular features! Members compete to send the first message of the day, and the bot keeps track of everyone's score. It's amazing how such a simple game has created such engagement - we've got members setting alarms for midnight just to try to win! 😄

Here's what our first message competition looks like: Screenshot 2023-03-04 at 5 28 37 PM

Technical Stuff (For The Curious) 🛠️

If you're interested in the technical side, here's how it all works:

  • The core bot is built with Python and Discord.py
  • AI features use OpenAI's GPT-4 and DALL·E 3 APIs
  • All the data is stored in a MySQL database on AWS
  • The dashboard is built with Streamlit

The code is organized into different modules (in the cogs folder) to keep things clean and maintainable. Each feature has its own space:

  • ai.py handles all the AI magic
  • server.py manages server-related commands
  • first.py runs our beloved first message game
  • And more!

What's Next? 🚀

I'm constantly working on making the bot better! Some things I'm excited about:

  • Exploring new AI models to add more features
  • Expanding our analytics capabilities
  • Adding more community games
  • Making the function calling system even smarter

The Impact 💫

What started as a fun project has turned into a vital part of our server. It's helped create a more engaged community, provided valuable insights through analytics, and shown me the practical applications of modern AI technologies. Plus, it's been an amazing learning experience in working with APIs, managing databases, and building user-friendly features.


Built with ❤️ by Alexander

Want to know more about any part of the project? Feel free to reach out! I love talking about it and sharing what I've learned along the way.

About

Discord bot with ChatGPT API and SQL database for logging server events.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages