An AI-powered Discord bot for community onboarding and safety. It welcomes genuine introductions in a dedicated channel, filters spam in every channel, and can assign a temporary new-member role on join.
Untagged admin and guild-owner messages are left unchanged. For everyone else, spam checks run first. Introduction handling runs only in the configured channel, and only if the message was not treated as spam. After the first successful welcome, later top-level messages from that user stay quiet. If an intro is deleted while the bot is still working, it does not reply.
- Personalized AI welcome with one conversation-starting question
- Intro validation (length and keywords) and AI content moderation
- Duplicate introduction detection and one welcome per user (in-memory)
- Ignores bots, replies, short greetings, and untagged admin messages
- AI spam detect: delete the message and warn in-channel
- Skip intro replies when the source message is deleted mid-processing
- Optional new-member role on join, with periodic age-out
- Fail-open spam and moderation when the LLM errors or returns empty output
Node.js v18+. Full Discord portal, intents, and permissions: docs/DEPLOYMENT.md.
git clone https://github.com/Git-Commit-Show/discord-ai.git
cd discord-ai
npm install
cp .env.example .envFill at least DISCORD_TOKEN, INTRO_CHANNEL_ID, OPENROUTER_API_KEY, AI_SERVICE, and MODEL. Then:
npm run devOr npm start without auto-reload.
npm test # Offline unit and integration tests (what CI runs)
npm run test:e2e # Live OpenRouter check; needs a real API keyGitHub Actions (.github/workflows/test.yml) runs npm test on pull requests, pushes to main, and manual workflow dispatch.
| Doc | Contents |
|---|---|
docs/REQUIREMENTS.md |
What is built vs planned |
docs/DESIGN.md |
Architecture and message flow |
docs/DEPLOYMENT.md |
Discord app, env, hosting |
EXAMPLES.md |
What the bot says (and when it stays silent) |
CONTRIBUTING.md |
Local setup, codebase map, PR bar |
Node.js, Discord.js, ResilientLLM, OpenRouter.
Apache-2.0.