Skip to content

Commit 8a01281

Browse files
committed
fix: move logging for command errors to fix not working
1 parent d0738f0 commit 8a01281

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,22 @@ app.command("/craftie-player", async ({ command, ack, respond, client }) => {
7070
const uuidOrUsername = args[0]; // The UUID or username of the player.
7171

7272
if (!uuidOrUsername) {
73+
console.log("No UUID or username provided.");
7374
return await client.chat.update({
7475
channel: command.channel_id,
7576
ts: message.ts,
7677
text: "Status not generated. Please provide a UUID or username.",
7778
});
78-
console.log("No UUID or username provided.");
7979
}
8080
const playerData = (await axios.get(`https://playerdb.co/api/player/minecraft/${uuidOrUsername}`));
8181
const userExists = (await playerData.data.success);
8282
if (!userExists) {
83+
console.log("Error: Player does not exist.");
8384
return await client.chat.update({
8485
channel: command.channel_id,
8586
ts: message.ts,
8687
text: "Status not generated. Player does not exists. (or an error occured)",
8788
});
88-
console.log("Error: Player does not exist.");
8989
};
9090
const uuid = (await playerData.data.data.player.id); console.log(uuid);
9191
const username = (await playerData.data.data.player.username); console.log(username);

0 commit comments

Comments
 (0)