All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 37s
1.9 KiB
1.9 KiB
TentacleBot - Agent Instructions
Quick Commands
dotnet restore && dotnet run # Run the bot locally
docker compose up --build -d # Run with Docker
docker compose logs -f # View Docker logs
Setup
- Set
DISCORD_BOT_TOKENenv var — secrets must not be stored inappsettings.json - Copy
.env.exampleto.envfor Docker:cp .env.example .env appsettings.jsonis gitignored — never commit it
Architecture
Program.cs— Entry point, DI setup, registers command modules from the assemblyServices/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).
Secrets
All secrets (API keys, passwords, tokens) must be read from environment variables — never from appsettings.json. Use Environment.GetEnvironmentVariable() directly in service constructors.
| Secret | Env Var |
|---|---|
| Discord bot token | DISCORD_BOT_TOKEN |
| LLM API key | LLM_API_KEY |
| Palworld server password | PALWORLD_PASSWORD |
Non-secret configuration (URLs, model names, numeric settings) may stay in appsettings.json via IConfiguration.
Gotchas
- Two
DiscordSocketClientinstances are created inProgram.cs— one for the bot client and one passed intoInteractionService. They are separate instances sharing the same config. - Token priority:
DISCORD_BOT_TOKENenv var is checked first, thenappsettings.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.