DRandomBot Project

showcase of my discord bot

7/22/20232 min read

Introducing DRandomBot.

A Discord bot developed using discord.py and Python! This little bot is packed with an many features, from fetching random dad jokes and adorable cat pictures to organizing players for games of tic-tac-toe, even a machine learning chatbot prototype my friends and I trained. among other fun functionalities. Here is a complete list of commands

Commands
  • $help: Display the help menu

  • $dad_joke: Get a random dad joke

  • $waifu: Get a random anime waifu picture

  • $kitty: Get a random kitty cat picture

  • $weather : Get weather of a city; replace 'city' by city's name

  • $meme: Get a random meme ---- currently not working, the API is dead

  • $join: Have the bot join the voice channel that the user is current in

  • $leave: The bot will leave the voice channel

  • $download <song_name>: The bot will download the youtube song as .mp3 and save it as 'song_name.mp3'; if no <song_name> specified, the file's original name will be used

  • $music <song_name>: The bot will play the selected song in voice channel

  • $music_r: The bot will play a random song, use this command again to play another song

  • $song_list: The bot will display a list of songs downloaded

  • $pause: The bot will pause current song

  • $tictactoe : Start TicTacToe game, replace by @discord_username

  • $mark : Place a mark on the board, position = integer ranging from 1 to 9

  • $quit: Quit the current TicTacToe game

  • $pokemon <pokemon_name> or <pokemon ID> : Find information about the pokemon

  • $ai_chat: Start the chatbot. Users can then talk to the bot normally without the "$" prefix, type quit to stop the chatbot.

  • $add_birthday: Adds a user's birthday to the bot's data base, and the bot will send a "Happy birthday" message on a user's birthday.

Some of the notable features
ML Chatbot

My friends and I are fascinated by ChatGPT, so we decided to dive into the world of machine learning and train our very own chatbot using Python. In the end, we decided to incorporate the chatbot into my discord bot. We are planning to train different language models based on different fictional characters' personality.

Aside from the fact that we don't really know much about AI, we also had significant trouble finding dataset. While we were able to generate some good data sets using ChatGPT, it was hard to find data set that is big enough to make it a fully functional chatbot. Nevertheless, we are quite happy and proud of this prototype.

Bot that says happy birthday!

Shout out to the main contributor of this feature, Kanyinsola.

This functionality presented a bit of challenge because we needed a way to store the birthday data somewhere, and have the bot check periodically to make sure that the bot does not miss anyone's birthday. While this sounds simple, but we did not have any experience with these in Python.

Kanyinsola decided to use a mongoDB to store the birthday data, as it would be a great exercise to learn about it and to add to her toolbox. Subsequently, she used AsyncIOScheduler module to handle the daily date check.

Conclusion

Creating DRandomBot has been a quite enjoyable experience. It brought liveliness into my Discord server and made interactions on the server more fun for my friends. Plus, it opened doors for me to explore new Python modules that proved invaluable for my subsequent major project alongside a friend.