Skip to content

jar285/discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bartender Bot

A Discord bot that acts as an interactive bartender, powered by ChatGPT, with a scalable architecture using FastAPI, Kafka, and ngrok.

Features

  • Discord bot with slash commands for interacting with a virtual bartender
  • AI-powered conversations using ChatGPT
  • Scalable message processing with Kafka
  • Local development with ngrok for webhook handling
  • Modern API layer with FastAPI

Prerequisites

  • Python 3.8+
  • Discord Developer Account
  • OpenAI API Key
  • ngrok Account
  • Kafka (or Docker for local Kafka setup)

Setup Instructions

  1. Clone this repository
  2. Install dependencies: pip install -r requirements.txt
  3. Create a .env file with the following variables:
    # Discord Configuration
    DISCORD_BOT_TOKEN=your_discord_bot_token
    DISCORD_APPLICATION_ID=your_application_id
    
    # OpenAI Configuration
    OPENAI_API_KEY=your_openai_api_key
    
    # ngrok Configuration
    NGROK_AUTH_TOKEN=your_ngrok_auth_token
    
    # Kafka Configuration (if using local setup)
    KAFKA_BOOTSTRAP_SERVERS=localhost:9092
    
  4. Run the bot: python src/main.py

Project Structure

├── docs/               # Documentation
├── src/                # Source code
│   ├── api/            # FastAPI routes and endpoints
│   ├── bot/            # Discord bot implementation
│   ├── kafka/          # Kafka producers and consumers
│   ├── ai/             # ChatGPT integration
│   ├── config.py       # Configuration management
│   └── main.py         # Application entry point
├── .env                # Environment variables (not in repo)
├── requirements.txt    # Project dependencies
└── README.md          # Project documentation

Development Workflow

  1. Start the FastAPI server
  2. Connect to Discord via the bot
  3. Use ngrok to expose the FastAPI server
  4. Register the ngrok URL with Discord for slash commands
  5. Start Kafka producers and consumers

License

MIT

About

THIS IS A TEST RUN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages