Skip to content

Commit

Permalink
feat: voiceMemberCount
Browse files Browse the repository at this point in the history
  • Loading branch information
Faf4a committed Oct 6, 2024
1 parent efa2b6e commit 73995c5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/functions/voiceMemberCount.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @param {import("..").Data} d
*/
module.exports = async (d) => {
const data = d.util.aoiFunc(d);

const [channelID = d.member?.voice?.channelId] = data.inside.splits;

const channel = await d.util.getChannel(d, channelID);

if (!channel) return d.aoiError.fnError(d, "channel", { inside: data.inside });

if (![d.util.channelTypes.Voice, d.util.channelTypes.Stage].includes(channel.type)) return d.aoiError.fnError(d, "custom", { inside: data.inside }, "Channel Type Is Not Voice/Stage");

data.result = channel.members.size ?? 0;

return {
code: d.util.setCode(data)
};
};

0 comments on commit 73995c5

Please sign in to comment.