Skip to content

Commit

Permalink
fix: error message when /join
Browse files Browse the repository at this point in the history
  • Loading branch information
yuimarudev committed Jan 11, 2025
1 parent 8dbeb7f commit 855dbdf
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions src/commands/join.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,27 @@ export default class Join implements ICommand {
],
});

await room.connect();

return await api.interactions.editReply(i.application_id, i.token, {
content: "",
embeds: [
{
description: "接続しました",
color: 0x00ff00,
},
],
});
try {
await room.connect();
await api.interactions.editReply(i.application_id, i.token, {
content: "",
embeds: [
{
description: "接続しました",
color: 0x00ff00,
},
],
});
} catch (e) {
await api.interactions.editReply(i.application_id, i.token, {
content: "",
embeds: [
{
description: `接続に失敗しました: \n\`\`\`\n${String(e)}\n\`\`\``,
color: 0xff0000,
},
],
});
}
}
}

0 comments on commit 855dbdf

Please sign in to comment.