OuiBot is a charming and interactive Discord bot inspired by a cat-enthusiast, "Ouiiiiii". It enhances Discord servers by detecting cat-related content in messages, responding with delightful interactions whenever cats are mentioned, or cat images and GIFs are shared.
- Cat Detection: Detects mentions of cats in text messages, using keyword matching.
- Cat GIFs Response: Automatically identifies a cat GIF from Tenor by leveraging web scraping techniques to look at image tags.
- Image Recognition: Identifies cat images in JPG or PNG format using a custom logistic regression model, and responds accordingly.
OuiBot is developed in Python, using several libraries to handle various functionalities:
- Discord Interaction: Uses
discord.pyfor seamless interaction with the Discord API. - Image Recognition: Employs a logistic regression model, built with
numpy, for recognizing cat images. - GIF Retrieval: Fetches cat-related GIFs from Tenor, utilizing
requestsandbeautifulsoup4for web scraping. - Environmental Variables: Manages API keys and sensitive data using
python-dotenv. - Image Processing:
Pillowlibrary is used for image data handling, crucial for the image recognition feature.
- Install Python
3.11on your system. - Clone the repository and navigate to the project directory.
- Install dependencies:
pip install -r requirements.txt - Set up a
.envfile containing Discord API token. - Run the bot:
python oui.py
The logistic regression model is trained on a dataset of cat images. The model is implemented using numpy to employ the vector operations involved in training. The model distinguishes between cat and non-cat images, which is central to the bot's image recognition feature.
A special shoutout to Daniel Kang for his expert advice on the Discord API, significantly contributing to OuiBot's development.