Management Chat Bot

A chat bot for Discord and Twitch. It allows managing Discord servers and Twitch chats. It can retrieve various user information and store it in a database. It can also interact with users.
Key points

Data Retrieval
One of the bot’s tasks is to retrieve information about users. To achieve this, I use the Twurple library to create a connection to the Twitch API, as well as the Discord.js library to connect to the Discord API. I collect data such as watch time, messages, commands, and presence times. This information is used to power a system of achievements and rewards, encouraging users to actively participate in the community.

Chat via LLM
I added a chat feature using an LLM. This allows users to chat with the bot via messages. The bot can answer general questions but can also be used for more specific inquiries. It is powered by data from the PostgreSQL and Firebase databases. Initially, the bot was configured with an Ollama model, but I now use a DeepSeek model, which is more efficient, faster, and less resource-intensive.
Challenges
I started learning how to set up LLMs with Ollama, but I had performance issues with long response times since the model ran locally. Today, I use a DeepSeek model, which is more efficient.
There was a large amount of data to manage and many automations linked to webhooks or recurring tasks (cron). The code structure needed to be well-adapted to these different tasks to save time in both developing new features and ensuring maintenance and security.