PteroStats

PteroStats Banner

Introduction

PteroStats is a Discord App/Bot designed to check Pterodactyl or Pelican Panel stats and post it to your Discord server.

Preview

PteroStats Image Preview PteroStats Console Preview PteroStats GIF Preview

Guide

Starting the App/Bot

  1. Create your Discord App/Bot.

  2. Invite your Discord App/Bot to your Discord server.

  3. Download this repository:

    • Download this repository and extract it.
    • Using Git: Run git clone https://github.com/HirziDevs/PteroStats.git in the command line.
  4. Run npm install in the root directory of the app/bot files.

  5. Run node index and answer the prompted questions to set up the app/bot.

    Setup
  6. Run node index if you want to start the app/bot again, and you're done!

    Console Logging

Changing Env Configuration

Tip

You can change other configuration at the config.yml file.

  1. Run node setup in the root directory of the app/bot files.

  2. Enter 2 to change configuration.

    Change Configuration
  3. Answer the provided question to set up the app/bot.

  4. Run node index if you want to start the app/bot again, and you're done!

Getting Panel API Key

Warning

The use of Application API keys is deprecated; you should use Client API keys.

Tip

Make sure the owner of the Client API key has access to the administrator panel.

  1. Go to your Pterodactyl or Pelican Panel and navigate to the Account Page.

    Home
  2. Click on the API Credentials button.

    Account Page
  3. Fill in the Description and click the Create button.

    Create Client API Key
  4. Copy the API key.

    API Key

Getting Channel ID

  1. Enable Developer Mode in your Discord settings.

    Discord User Settings
  2. Right-click the text channel and select Copy ID.

    Right Click Channel

Using Custom Emoji

  1. Type \ in the server that has the custom emoji you want.

    Type \ on the chat
  2. Select the custom emoji you want.

    Select Custom Emoji
  3. Copy the text!

    Copy Emoji ID
  4. Paste the emoji ID into the config.

    Status Config

Blacklist Nodes

  1. Select a node from the node list on the admin page.

    Pterodactyl Nodes List Pelican Nodes List
  2. Check the URL and copy the node ID.

    Pterodactyl Node ID Pelican Node ID
  3. Paste the ID into the blacklist in the config.

    Blacklist Config

Tip

You can add more than one node to the blacklist.

Blacklist Config

=======

Notifier

Get a notification on Discord when your panel or specific nodes are currently down.

Notifier Preview

Enabling Notifier

Open config.yml and set enable at the notifier configuration to true

Notifier Config

Getting Discord Webhook URL

  1. Go to the channel settings of the channel you want to set for the notifier.

    Notifier Config
  2. Go to integrations and select View Webhooks or Create Webhook.

    Notifier Config
  3. Create a new webhook and copy the Webhook URL

    Notifier Config
  4. Paste the Webhook URL on the webhook notifier configuration.

    Notifier Config

Tip

You can change the webhook icon and username on the webhook settings.

Notifier Config

Docker

This is a guide to run the bot using docker (alternative way to run the bot)

Installation

curl -fsSL https://get.docker.com | sh

Docker Compose

Copy the docker-compose.yml file to your server and run docker compose pull Copy the config.yml file at the same directory as the docker-compose.yml file and configure it Fill the environment variables in the docker-compose.yml file and run the bot using docker compose up -d

docker compose up -d
docker compose logs -f pterostats

Docker Run

docker run -d --name pterostats -e PanelURL=<PanelURL> -e PanelKEY=<PanelKEY> -e DiscordBotToken=<DISCORD_BOT_TOKEN> -e DiscordChannel=<DISCORD_CHANNEL_ID> -v $(pwd)/config.yml:/app/config.yml ghcr.io/hirzidevs/pterostats:latest
docker logs -f pterostats

Reporting a Bug

Enable log_error in the config.yml file and check the console for the error message. After that, report it to our Discord server at Support Server.

Description
No description provided
Readme MIT 667 KiB
Languages
JavaScript 99.8%
Dockerfile 0.2%