SkillfulAI
  • Skillful AI
    • Welcome
    • About us
    • Ecosystem
  • Web SDK
    • Overview
    • Getting Started
      • Installation
      • Quick Start
      • Authentication
    • SDK Reference
    • Templates
      • Telegram Bot Template
      • Express Server Template
        • API Reference
      • Discord Bot Template
        • ProActive Mode
      • Kick Stream Bot
        • Getting Started
          • Installation
          • Quick Start
        • Create Commands
        • Advanced Configurations
  • Unity Gaming SDK
    • Overview
    • Getting Started
      • Installation
      • Authentication
    • Services
      • Skillful Agents
        • Overview
        • Quick Start
        • Service Reference
      • Smart NPCs
        • Overview
        • Quick Start
        • Service Reference
      • Skillful Inference
        • Overview
        • Quick Start
        • Service Reference
          • Question Answering
          • Sentence Similarity
          • Speech Recognition
          • Text Classification
          • Text Generation
          • Text Summary
          • Text-To-Image
          • Zero Shot Classification
          • Translation (Localization)
    • Audio Recorder
    • Additional Utilities
Powered by GitBook
On this page
  • Proactive Mode Guide
  • Overview
  • Enabling Proactive Mode
  • How It Works
  • Configuration
  • Best Practices

Proactive Mode Guide

A deep dive into the intelligent conversation engagement system of the Skillful AI Discord bot.

Overview

Proactive mode allows the bot to intelligently join conversations based on activity levels and engagement metrics. The system uses multiple factors to determine when and how to engage in ongoing discussions.

Enabling Proactive Mode

const bot = new SkillfulDiscordBot({
    discordToken: 'token',
    skillfulApiKey: 'key',
    proactive: true,              // Enable proactive mode
    proactiveThreshold: 50        // Set engagement threshold
});

How It Works

Engagement Scoring

The bot calculates an engagement score (0-100) based on three factors:

  1. Message Frequency (30%)

    • Measures messages per minute

    • Optimal range: 4-8 messages/minute

    • Maximum score: 30 points

  2. Active Participants (30%)

    • Counts unique users in conversation

    • Each user adds 10 points

    • Maximum score: 30 points

  3. Message Recency (40%)

    • Measures time since last message

    • Decays over minutes

    • Maximum score: 40 points

Engagement Decision

For each message, the bot:

  1. Calculates the engagement score

  2. Generates a random number (0-100)

  3. Engages if the random number is below the score

  4. Applies a 30-second cooldown after engagement

Example:

Score: 80.0 (highly active conversation)
Roll: 45.6 (random number)
Result: Engage (45.6 < 80.0)

Cooldown System

  • 30-second cooldown between engagements

  • Applies per channel

  • Prevents excessive responses

  • Resets after each engagement

User Context

The bot maintains:

  • Last 50 messages per channel

  • Active user tracking

  • User activity timestamps

  • Proper Discord mention formats

Configuration

Threshold Adjustment

// More selective engagement
const bot = new SkillfulDiscordBot({
    proactive: true,
    proactiveThreshold: 70  // Higher threshold
});

// More frequent engagement
const bot = new SkillfulDiscordBot({
    proactive: true,
    proactiveThreshold: 30  // Lower threshold
});

Debug Logging

Enable detailed logging:

const bot = new SkillfulDiscordBot({
    proactive: true,
    debug: true
});

Example debug output:

Score breakdown for channel 123456789:
    Messages: 4
    Frequency (30%): 30.0
    Participants (30%): 10.0 (1 users)
    Recency (40%): 40.0 (0.0s ago)
    Total Score: 80.0

Best Practices

  1. Threshold Selection

    • 50: Balanced engagement

    • 70: More selective

    • 30: More frequent

    • Test and adjust based on your community

  2. Channel Considerations

    • Works best in active channels

    • Adapts to channel activity levels

    • Respects channel-specific cooldowns

  3. User Experience

    • Bot mentions active users naturally

    • Maintains conversation context

    • Avoids spam through cooldown system

PreviousDiscord Bot TemplateNextKick Stream Bot

Last updated 3 months ago