Skip to content

Commit 1f5e956

Browse files
committed
fix(0.0.7.2): fixed crashing on /xp
1 parent 3523090 commit 1f5e956

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

bot/commands.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ const commands: Record<string, Command> = {
133133
const guild = interaction.guild?.id
134134
const user = interaction.user.id
135135
const xp = await makeGETRequest(guild as string, user)
136+
137+
if (!xp) {
138+
await interaction.reply({
139+
ephemeral: true,
140+
content: "No XP data available."
141+
});
142+
return;
143+
}
144+
136145
const progress = xp.user_progress_next_level;
137146
const progressBar = createProgressBar(progress);
138147

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "xpbot",
33
"type": "module",
4-
"version": "0.0.7.1",
4+
"version": "0.0.7.2",
55
"scripts": {
66
"api": "bun api/index.ts",
77
"bot": "bun bot/index.ts"

0 commit comments

Comments
 (0)