Skip to content

betahub-io/bot-status-checker

Repository files navigation

Discord Bot Status Monitor

A Discord bot designed to monitor the health of other Discord bots by sending test messages and verifying their responses. If a bot fails to respond correctly within the configured threshold, it triggers an alert through AWS SNS.

Features

  • Monitors multiple Discord bots through configured test messages
  • Groups bots with the same test message to reduce channel noise
  • Expects specific responses from each monitored bot
  • Configurable failure thresholds for alerts
  • Configurable check intervals
  • AWS SNS integration for failure notifications
  • Supports monitoring in specific Discord servers and channels

Setup

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Create a configuration file config.json with the following structure:
    {
      "botToken": "YOUR_BOT_TOKEN",
      "serverId": "YOUR_SERVER_ID",
      "channelId": "YOUR_CHANNEL_ID",
      "aws": {
        "region": "YOUR_AWS_REGION",
        "snsTopicArn": "YOUR_SNS_TOPIC_ARN",
        "credentials": {
          "accessKeyId": "YOUR_AWS_ACCESS_KEY_ID",
          "secretAccessKey": "YOUR_AWS_SECRET_ACCESS_KEY"
        }
      },
      "monitoredBots": [
        {
          "id": "BOT_ID",
          "testMessage": "!ping",
          "expectedResponse": "pong",
          "failureThreshold": 3
        }
      ],
      "checkIntervalMs": 60000
    }

Running Tests

npm test

Running the Bot

npm start

Configuration Options

  • botToken: Your Discord bot token
  • serverId: Discord server ID where monitoring will take place
  • channelId: Channel ID where messages will be sent
  • aws.region: AWS region for SNS
  • aws.snsTopicArn: ARN of the SNS topic for alerts
  • aws.credentials: AWS credentials for SNS access
    • accessKeyId: AWS access key ID
    • secretAccessKey: AWS secret access key
  • monitoredBots: Array of bots to monitor
    • id: Discord ID of the bot to monitor
    • testMessage: Message to send to the bot
    • expectedResponse: Expected response from the bot
    • failureThreshold: Number of failures before triggering an alert
  • checkIntervalMs: Interval in milliseconds between health checks (default: 60000)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors