Skip to content

Commit

Permalink
🔁 UPDATE: Verifying environment readiness.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maseshi committed Apr 13, 2023
1 parent dce0965 commit 143a055
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
13 changes: 13 additions & 0 deletions source/handlers/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ module.exports = (client) => {

// Initial call to start submitting data.
if (client.mode === "start" && enable) {
if (!apiKey) return client.console.fail("monitor-loading", {
"text": "The monitor API Key was not found in the environment. Opt out of sending performance data.",
"failColor": "yellowBright"
});
if (!pageId) return client.console.fail("monitor-loading", {
"text": "The monitor page ID was not found in the environment. Opt out of sending performance data.",
"failColor": "yellowBright"
});
if (!metricId) return client.console.fail("monitor-loading", {
"text": "The monitor metric ID was not found in the environment. Opt out of sending performance data.",
"failColor": "yellowBright"
});

client.console.add("monitor-loading", {
"text": "Preparing to send data to matrix"
});
Expand Down
15 changes: 11 additions & 4 deletions source/utils/clientUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@ const updateApplicationCommands = async (client, reload = false) => {
{ "body": data }
);
} else {
await rest.put(
Routes.applicationGuildCommands(clientID, guildID),
{ "body": data }
);
if (guildID) {
await rest.put(
Routes.applicationGuildCommands(clientID, guildID),
{ "body": data }
);
} else {
client.console.fail("app-commands-loading", {
"text": "The testGuild key was not found in the environment. You may not be able to see recent commands.",
"status": "non-spinnable"
});
}
}
if (!reload) {
client.console.update("app-commands-loading", {
Expand Down

0 comments on commit 143a055

Please sign in to comment.