Skip to content
/ castor Public

An over-engineered user fetching with additional status monitoring for the vultrex.dev discord bots

Notifications You must be signed in to change notification settings

vultrex/castor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Castor

An over-engineered Discord bot status checker and user profile grabber for the Vultrex Development Discord server. Castor monitors bot statuses, tracks user profiles, and provides comprehensive staff tools for managing the server's bot ecosystem.

Features

  • Bot Status Monitoring:

    • Real-time tracking of bot online/offline status
    • Periodic status updates every 5 minutes
    • Handles both online and idle states as "online"
    • Efficient member caching for optimal performance
  • Role-Based Bot Management:

    • Monitors only bots with the designated bot role
    • Ignores bots with the ignore role
    • Automatic database management based on role changes
  • User Profile Management:

    • Tracks user information including usernames and display names
    • Monitors profile picture changes
    • Maintains user role associations
  • Staff Tools:

    • Comprehensive bot status dashboard
    • User profile management interface
    • Role-based access control
    • Detailed activity logging
  • Technical Features:

    • Efficient member caching system
    • Real-time presence updates
    • RESTful API integration
    • Comprehensive debug logging

Environment Variables

DISCORD_BOT_TOKEN=your_bot_token
GUILD_ID=your_guild_id
BOT_ROLE_ID=role_id_for_bots_to_monitor
IGNORE_ROLE_ID=role_id_for_bots_to_ignore
API_URL=your_api_url

Status Monitoring Logic

The bot considers a bot as "online" when:

  • The bot has the designated bot role
  • The bot does not have the ignore role
  • The bot's presence status is either "online" or "idle"

A bot is considered "offline" when:

  • The bot's presence status is "offline" or "dnd"
  • The bot is not found in the guild
  • The bot has the ignore role

API Endpoints

The service integrates with a REST API for status updates:

  • POST /api/bots/update: Updates bot status with the following payload:
    {
      botId: string;
      guildId: string;
      username: string;
      displayName: string;
      profilePicture: string;
      ownerId: string;
      status: 'online' | 'offline';
      lastStatusCheck: Date;
    }

Development

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Set up environment variables
  4. Run the bot:
    npm start

Logging

The service provides detailed logging for:

  • Bot status changes
  • Role-based filtering
  • API interactions
  • Error conditions
  • Member caching operations
  • User profile updates
  • Staff actions

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

About

Castor is specifically designed for the Vultrex Development Discord server, providing comprehensive tools for managing and monitoring the server's bot ecosystem and user profiles. It's built with scalability and maintainability in mind, making it easy to extend and modify for future needs.

About

An over-engineered user fetching with additional status monitoring for the vultrex.dev discord bots

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published