The method room.voice.fetch()
retrieves information about the current voice chat status in the room. It does not require any parameters.
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "voice") {
bot.room.voice.fetch().then(players => {
console.log("Voice Chat Users: ", players);
}).catch(e => { console.error(e) });
}
});
{
seconds_left: 3572,
auto_speakers: [
'62cd82da462f6b0d3c1a9c45',
'55bb64735531104341039ca8',
],
users: {
'55bb64735531104341039ca8': 'muted',
'62cd82da462f6b0d3c1a9c45': 'voice'
}
}
Sub-Methods:
The get.active()
method retrieves the active users currently in the voice chat.
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "active") {
bot.room.voice.get.active().then(active => {
active.forEach(async user => {
const username = await bot.room.players.username(user);
console.log("Voice Chat Active: ", username);
});
}).catch(e => { console.error(e) });
}
});
The get.auto_speakers()
method retrieves users who are automatically enabled as speakers due to moderator or designer permissions.
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "auto speakers") {
bot.room.voice.get.auto_speakers().then(speakers => {
console.log("Voice Chat Auto Speakers: ", speakers);
}).catch(e => { console.error(e) });
}
});
The get.muted()
method retrieves users who are muted in the voice chat.
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "muted") {
bot.room.voice.get.muted().then(muted => {
muted.forEach(async user => {
const username = await bot.room.players.username(user);
console.log("Voice Chat Muted: ", username);
});
}).catch(e => { console.error(e) });
}
});