
Basic Pterodactyl Discord Bot | A simple discord bot for starting and stopping servers [1.1]
Source code: https://github.com/kevinsnijder/pterodactyl-discord-bot
1. Commands
/login [client api key] - Logs you into the pterodactyl panel
/deletelogin [user] - Removes the login from the provided user
/listservers - Lists all servers your user can control. Uses both the clients API key and optionally also the globally set API key.
/startserver [server guid] - Starts the provided server
/stopserver [server guid] - Stops the provided server
Image 1: /listservers (optionally) shows global servers without logging in, but shows more servers after logging in with my own client key
Image 2: /startserver shows starting with timer
Image 3: /stopserver autocompletes with servers that are currently online
2. Features
2.1 Implemented features:
- Auto-updates every start by pulling the newest image
- Automatically assign a role to logged in users and remove the role when deleting logins
- All commands have proper autocompletion functions.
/startserver only autocompletes offline servers
/stopserver only autocompletes online servers
/deletelogin only autocompletes logged in users
- Ability to set a global client key that every client can use whether they are logged in to the bot or not
Once users are logged they can control both the servers from the global API key and their personal API key
2.2 Features for future releases (WIP):
- Setting a channel where console output of a specified server will be logged (/setconsolechannel [serverid] [allowcommands])
Should also be able to send command from the chat directly to the pterodactyl console
3. Setup
3.1. Uploading the egg to pterodactyl
- Go to your pterodactyl panel -> Admin -> Nests
- On the top right press "Import Egg"
- Select the egg from your disk
- Press "Import"
3.2 Creating a discord bot for your server
- Make sure "developer mode" is enabled on your discord account (discord client -> settings -> advanced -> "developer mode")
- Go to the discord developer applications page.
- Press "New application"
- Optional: Set an icon and some basic information about your bot
- Go to the Bot tab
- Disable "Public bot"
- Press "Reset token" and copy the token. You will need it when configuring the server in pterodactyl
- Go to the OAuth2 -> URL Generator tab
- In the "Scopes" panel, select "Bot"
- In the "Bot permissions" panel, select the following:
- Send messages
- Send messages in threads
- Open the generated URL in a new browser tab to invite the bot to your server
3.3 Creating the server in pterodactyl
- Create a server as usual and select the egg you imported
- Enter the correct values for the variables
- Required: Discord bot token - The token you got from the "Bot" tab
- Optional: Pterodactyl global API key - A client API key that can be used by everyone on the server.
You could create a basic user in pterodactyl with some start/stop permissions on some specific servers you would like everyone to be able to control.
When users log in with their own client API key both keys can be used.
- Optional: Discord logged in group ID - The ID of the group logged in users should be added to. Make sure this group is ranked lower than the group of the discord bot.
INFORMATION
Price:
FREE
Views:
1240
Downloads:
375
First Release:
July 11, 2023, 2:29 pm
Last Release:
January 4, 2024, 12:10 am
Ratings:
Kevin Resources
Double Action: Boogaloo Egg
An egg for the source mod Double Action: Boogaloo
Basic Pterodactyl Discord Bot
A simple discord bot for starting and stopping servers