No longer crash if unable to login to VRChat

This commit is contained in:
2023-04-23 15:40:44 +07:00
parent 7731fbdd64
commit 874a65888d
3 changed files with 17 additions and 8 deletions
-6
View File
@@ -22,12 +22,6 @@ const EMBEDS = {
user: data.getUser()
});
},
NOT_INITIALIZED: (data: HybridInteractionMessage) => {
return makeErrorEmbed({
title: `VRChat feature is disabled`,
user: data.getUser()
});
},
ERROR: (data: HybridInteractionMessage) => {
return makeErrorEmbed({
title: `Something went wrong while connecting to VRChat`,
+1 -1
View File
@@ -63,7 +63,7 @@ export default class VRChat extends DiscordModule {
const Guild = await Prisma.client.guild.findFirst({ where: { id: data.getGuild()!.id } });
if (!Guild) return;
if (!VRChatAPI.client)
if (!VRChatAPI.isReady())
return await sendHybridInteractionMessageResponse(data, {
embeds: [EMBEDS.NOT_INITIALIZED(data)]
});