This is a Discord bot that uses the OpenWebUI API to generate responses to chat messages.
- Python 3.7+
- Discord bot token with Message Content Intent enabled
- OpenWebUI API key
-
Clone this repository or download the files.
-
Create a new
.envfile based on the provided template:DISCORD_TOKEN=your_discord_bot_token_here OPENWEBUI_API_URL=http://localhost:3000/api/chat/completions OPENWEBUI_API_KEY=your_openwebui_api_key_here MODEL_ID=your_model_id_here STATUS_MESSAGE=Online and ready to chat! CHANNEL_ID=your_channel_id_here -
Edit the
system_prompt.txtfile with your desired system prompt, or use the default:You are a helpful assistant. -
Install the required dependencies:
pip install -r requirements.txt -
Run the bot:
python bot.py
You can customize the bot's behavior by modifying the bot.py file, particularly the get_chat_response function and the message handling in on_message.
This project is open source. See the LICENSE file for details.