33 lines
1.4 KiB
Markdown
33 lines
1.4 KiB
Markdown
# TentacleBot - Agent Instructions
|
|
|
|
## Quick Commands
|
|
|
|
```bash
|
|
dotnet restore && dotnet run # Run the bot locally
|
|
docker compose up --build -d # Run with Docker
|
|
docker compose logs -f # View Docker logs
|
|
```
|
|
|
|
## Setup
|
|
|
|
1. Set `DISCORD_BOT_TOKEN` env var (preferred) or edit `appsettings.json`
|
|
2. Copy `.env.example` to `.env` for Docker: `cp .env.example .env`
|
|
3. `appsettings.json` is gitignored — never commit it
|
|
|
|
## Architecture
|
|
|
|
- **`Program.cs`** — Entry point, DI setup, registers command modules from the assembly
|
|
- **`Services/BotService.cs`** — Core bot lifecycle (login, ready handler, interaction routing)
|
|
- **`Commands/GeneralCommands.cs`** — Slash commands (`/general ping`, `/general hello`, `/botinfo`)
|
|
|
|
Add new commands by creating a class in `Commands/` that extends `InteractionModuleBase<SocketInteractionContext>`. Commands are auto-discovered via `AddModulesAsync(typeof(Program).Assembly)`.
|
|
|
|
## Gotchas
|
|
|
|
- **Two `DiscordSocketClient` instances** are created in `Program.cs` — one for the bot client and one passed into `InteractionService`. They are separate instances sharing the same config.
|
|
- **Token priority**: `DISCORD_BOT_TOKEN` env var is checked first, then `appsettings.json` → `Discord:BotToken`.
|
|
|
|
## No tests, no lint config
|
|
|
|
This project has no test framework, no linting, and no CI. `dotnet build` is the only verification step.
|