A little Python script I coded that uses nextcord & OpenAI API with a self-hosted Ollama model. It's easy to configure and set up yourself. Forgive the sloppy code it's my first big project.
Make sure you change the script to include your Discord bot token which you can create on the Discord Developer Portal. I also would not recommend storing it in plain text! Learn how to store stuff like that in a .env file.