Skip to content

Commit

Permalink
Allow for custom pterodactyl ready message
Browse files Browse the repository at this point in the history
  • Loading branch information
GoudronViande24 committed Jun 2, 2022
1 parent dee88a4 commit b33cb2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 7 additions & 2 deletions events/pterodactylStart.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { Client } from "discord.js";
import Artibot from "../index.js";

export const name = "ready";
export const once = true;

/**
* Send pterodactyl started trigger
* @param {Client} client
* @param {Artibot} artibot
*/
export function execute() {
export function execute(client, { config: { pterodactylReadyMessage } }) {
if ("RUNS_IN_PTERODACTYL" in process.env && process.env.RUNS_IN_PTERODACTYL) {
console.log("Pterodactyl start trigger");
console.log(pterodactylReadyMessage);
}
}
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class Artibot {
* @param {boolean} [config.advancedCorePing=true] - Set to false if you want to hide advanced infos from ping commands
* @param {boolean} [config.checkForUpdates=true] - Set to false if you don't want the bot to check for new updates
* @param {boolean} [config.debug=false] - Set to true to show debug messages in console
* @param {string} [config.pterodactylReadyMessage="Pterodactyl start trigger"] - Set a custom ready trigger message for Pterodactyl
*/
constructor({
ownerId,
Expand All @@ -51,7 +52,8 @@ export class Artibot {
embedColor = "#06476d",
advancedCorePing = true,
checkForUpdates = true,
debug = false
debug = false,
pterodactylReadyMessage = "Pterodactyl start trigger"
}) {
// Verify that the owner ID is set
if (!ownerId) throw new Error("You must set the owner ID.");
Expand All @@ -77,7 +79,8 @@ export class Artibot {
embedColor,
advancedCorePing,
checkForUpdates,
debug
debug,
pterodactylReadyMessage
}

this.version = version;
Expand Down

0 comments on commit b33cb2e

Please sign in to comment.