A privacy-conscious, production-ready Discord user bot with AI chat, reminders, and utility commands. Built with Node.js, Discord.js v14, PostgreSQL, and robust security best practices.
- AI Chat:
/ai
command with custom API key support (OpenRouter, OpenAI, Grok) - Reminders:
/remind
command for scheduling reminders - Utilities:
/weather
,/wiki
,/joke
,/cat
,/dog
,/8ball
,/whois
- Ephemeral Replies for sensitive commands
- Encrypted API Key Storage (AES-256-GCM)
- Rate Limiting & Logging
- Express Status Endpoint for monitoring
git clone https://github.com/scanash00/bot.git
cd bot
pnpm i
Copy .env.example
to .env
and fill in the required values:
DISCORD_TOKEN
(your bot token)DATABASE_URL
(Postgres connection string)OPENROUTER_API_KEY
(optional, default AI key)API_KEY_ENCRYPTION_SECRET
(32+ char secret)STATUS_API_KEY
(for status endpoint)ALLOWED_ORIGINS
,NODE_ENV
, etc.CLIENT_ID
(your discord bot id, copy it from the dashboard)
Run all SQL migrations:
pnpm run scripts/run-migration.js # or node scripts/run-migration.js
- Start the bot:
pnpm start
- Add the bot to your account and use
/ai
,/remind
, etc. - Use
/ai use_custom_api:true
to set your own API key (encrypted)
- No plaintext API keys stored or logged
- User data is encrypted and can be deleted by user command
- No data sold or shared with third parties
- See https://bot.pur.cat/legal/privacy for full policy
- PRs welcome! Open issues for bugs/feature requests.
- Follow code style (ESLint, Prettier).
- Add tests for new features.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
You are free to share and adapt the code for non-commercial purposes, provided you give appropriate credit.
See LICENSE and Creative Commons CC BY-NC 4.0 for details.
- Start the bot:
pnpm start
- Use
/ai
for AI chat, with optional custom API key for private usage - Use
/remind
to schedule reminders - Use utility commands:
/weather
,/wiki
,/joke
,/cat
,/dog
,/8ball
,/whois
- Sensitive commands use ephemeral replies for privacy
- Use
/ai use_custom_api:true
to set your own (encrypted) API key
- Node.js 16.9.0 or higher
- Discord.js 14.11.0