Community Discord Bot
Build a Discord bot that moderates, answers FAQs, welcomes new members, and tracks community health
š§ Ingredients
š APIs
bot_presence_messages_reactions_moderation_member_events
š Alternatives:
faq_database_and_community_knowledge_base
š Alternatives:
answer_questions_that_go_beyond_the_faq
š Alternatives:
š Step-by-Step Build Guide
Set up a Discord bot with appropriate permissions
1. Set up a Discord bot with appropriate permissions: read/send messages, manage messages, kick/ban
Set up a Discord bot with appropriate permissions: read/send messages, manage messages, kick/ban Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
š§ Human Required
- ⢠## Create a Discord Bot 1. Go to [discord.com/developers](https://discord.com/developers/applications) 2. Click **New Application** ā name it 3. Go to **Bot** tab ā click **Add Bot** 4. Enable: Message Content Intent, Server Members Intent 5. Copy the **Bot Token** (keep it secret!) 6. Go to **OAuth2 ā URL Generator** 7. Select scopes: bot, applications.commands 8. Select permissions: Send Messages, Read Messages, Manage Messages 9. Use the generated URL to invite the bot to your server ā±ļø Takes about 5 minutes.
Welcome system
2. Welcome system: when a new member joins, DM them with server rules, channel guide, and getting started info
Welcome system: when a new member joins, DM them with server rules, channel guide, and getting started info Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
FAQ system
3. FAQ system: maintain a database of common questions and answers. When someone asks a known FAQ, respond with the answer and link to docs
FAQ system: maintain a database of common questions and answers. When someone asks a known FAQ, respond with the answer and link to docs Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Moderation
4. Moderation: detect spam (repeated messages, suspicious links), auto-delete and warn. Escalate to mods for borderline cases
Moderation: detect spam (repeated messages, suspicious links), auto-delete and warn. Escalate to mods for borderline cases Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Track community metrics
5. Track community metrics: messages per day, active members, new joins, most active channels
Process the data and calculate the requested metrics. Steps: 1. Validate input data ā check for nulls, out-of-range values, duplicates 2. Apply the calculation/aggregation logic 3. Compare against benchmarks or previous periods if available 4. Format results with appropriate precision (2 decimal places for percentages, whole numbers for counts) Include: current value, previous value, change (absolute and %), trend direction (āāā). Flag any anomalies: values >2 standard deviations from the mean. If insufficient data for a reliable calculation, state the minimum needed and return partial results.
Detect unanswered questions
6. Detect unanswered questions: if a message in #help has no replies after 2 hours, ping a helper role
Detect unanswered questions: if a message in #help has no replies after 2 hours, ping a helper role Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Weekly
7. Weekly: community health report ā new members, message volume, top contributors, unanswered questions, moderation actions
Compile the gathered data into a structured report. Format as clean Markdown with: - Title/date header - Executive summary (2-3 sentences) - Key metrics section with actual numbers - Detailed sections with bullet points - Action items or recommendations at the end Keep it scannable ā busy people read reports in 30 seconds. Use emoji sparingly for visual anchors (š metrics, ā wins, ā ļø concerns, š action items). Include data comparisons: "X this period vs Y last period (āZ%)" If any data source was unavailable, note it clearly: "ā ļø [Source] data unavailable ā excluded from this report."
Monthly
8. Monthly: community insights ā growth trends, engagement patterns, popular topics, member retention
Monthly: community insights ā growth trends, engagement patterns, popular topics, member retention Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
š¤ Example Agent Prompt
Set up a Discord bot with appropriate permissions: read/send messages, manage messages, kick/ban Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Copy this prompt into your agent to get started.