Skip to content

Commit

Permalink
fix: bad status request (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
d0ctr authored Feb 19, 2024
2 parents ebecba8 + df0d853 commit f6ce5cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion discord/discord-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ class DiscordClient {
};

const channel = this.client.channels.resolve(channel_id);
if (channel == null) return res.sendStatus(404);

result.type = channel.type == ChannelType.GuildVoice ? 'voice' : 'other';
result.name = channel.name;
result.type == 'voice' && result.members.push(...channel.members.map(member => {
Expand All @@ -170,7 +172,7 @@ class DiscordClient {
camera: member.voice.selfVideo,
activity: member?.presence?.activities?.[0]?.name
};
}))
}));
res.json(result);
});
});
Expand Down

0 comments on commit f6ce5cd

Please sign in to comment.