This is a Discord bot designed to facilitate scheduling and potentially other AI-driven interactions within a Discord server. It leverages Large Language Models (LLMs) via OpenRouter and uses MongoDB for data persistence.
- Discord Integration: Interacts with users through Discord commands.
- LLM Capabilities: Uses external LLM services (currently configured for OpenRouter) for tasks like processing natural language.
- Scheduling Logic: Contains logic for scheduling events or speakers (details likely found in
lib/schedulingLogic.js
andmodels/scheduledSpeaker.js
). - MongoDB Persistence: Stores scheduling information and potentially other data in a MongoDB database.
- Web Server: Includes a basic web server (likely for health checks or simple API endpoints).
.
├── Dockerfile # Docker configuration
├── README.md # This file
├── api/ # API route definitions (likely for the web server)
├── config/ # Configuration files (e.g., API keys, DB connection)
├── docs/ # Project documentation (plans, specs, tutorials)
├── index.js # Main application entry point
├── lib/ # Core application logic
│ ├── discord/ # Discord bot specific logic (commands, connection)
│ ├── llm/ # LLM integration logic
│ ├── mongo/ # MongoDB connection and helper logic
│ └── schedulingLogic.js # Logic related to scheduling
├── middleware/ # Express middleware (e.g., authentication)
├── models/ # Mongoose models for database schemas
├── package.json # Project dependencies and scripts
├── package-lock.json # Exact dependency versions
├── server.js # Web server setup (Express)
└── test/ # Automated tests
- Node.js and npm
- MongoDB instance (local or remote)
- Discord Bot Token
- OpenRouter API Key
-
Clone the repository:
git clone <repository-url> cd ai-in-action-bot
-
Install dependencies:
npm install
-
Configure environment variables: Create a
.env
file in the root directory and add the necessary variables (refer toconfig/index.js
for required variables likeMONGODB_URI
,DISCORD_TOKEN
,OPENROUTER_API_KEY
,CLIENT_ID
,GUILD_ID
).Example
.env
file:MONGODB_URI=mongodb://localhost:27017/aiia-bot DISCORD_TOKEN=your_discord_bot_token OPENROUTER_API_KEY=your_openrouter_api_key CLIENT_ID=your_discord_client_id GUILD_ID=your_discord_guild_id # Add any other required variables from config/index.js
- Deploy Discord commands:
node lib/discord/deploy-commands.js
- Start the bot and server:
npm start
-
Build the Docker image:
docker build -t ai-in-action-bot .
-
Run the Docker container:
You need to provide the necessary environment variables when running the container. Create a
.env
file as described in the Installation section.# Make sure your .env file is in the current directory docker run --env-file .env -p 3000:3000 --name aiia-bot-instance ai-in-action-bot
--env-file .env
: Loads environment variables from your.env
file.-p 3000:3000
: Maps port 3000 on your host to port 3000 in the container.--name aiia-bot-instance
: Assigns a name to the container for easier management.
The bot should now be running inside the Docker container.
Run the test suite:
npm test
Please refer to the documentation in the docs/
directory for contribution guidelines, specifications, and tutorials.