Skip to content

RealyStupid/Discord_Bot_AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord AI Bot

This project is a local AI powered Discord bot that uses a self hosted model through Ollama. The bot reads user messages, sends them to a local model, and replies in a dark, poetic, glitch themed narrative style. The bot maintains conversation history per user and follows a structured narrative arc that evolves over time.

Features

  • Local AI inference using Ollama
  • Message based command system using the !ask prefix
  • Per user conversation memory
  • System prompt with a narrative arc and atmospheric tone
  • Safe and simple Python code structure
  • No external API keys required

Requirements

  • Python 3.10 or newer
  • Ollama installed and running locally
  • A Discord bot token
  • The following Python packages:
    • discord.py
    • requests

Setup

  1. Install dependencies inside your virtual environment:
pip install discord.py requests
  1. Make sure Ollama is installed and that you have pulled a model:
olama pull llama3
  1. Place your Discord bot token inside the client.run() call in bot.py.

  2. Run the bot:

python ai__bot.py

How It Works

The bot listens for messages that begin with !ask. When a message is received, the bot builds a prompt using a system instruction block, the user's conversation history, and the new message. The prompt is sent to the local model through Ollama's HTTP API. The model response is then returned to the user in Discord.

File Overview

  • ai_test.py
    Contains the ask_ai function that communicates with the local model.

  • ai__bot.py
    Contains the Discord bot logic, message handling, memory system, and prompt building.

Notes

This bot is designed for local experimentation and creative narrative interactions. It does not use cloud services and does not require any external API keys. All AI processing is performed on the user's machine.

About

A very basic test for AI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages