The bot.info
object provides methods for retrieving various information about the bot and the room it's currently in. These methods are built into the package to simplify development tasks by directly accessing essential bot and room details.
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "bot id") {
const bot_id = bot.info.user.id;
console.log('Bot ID:', bot_id);
}
});
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "room id") {
const roomId = bot.info.roomId();
console.log('Room ID:', roomId);
}
});
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "owner id") {
const owner_id = bot.info.owner.id;
console.log('Owner ID:', owner_id);
}
});
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "connection id") {
const connection_id = bot.info.connection_id;
console.log('Connection ID:', connection_id);
}
});
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "room name") {
const room_name = bot.auth.room.name;
console.log('Room Name:', room_name);
}
});
<aside> 💡 These methods offer convenient ways to access vital bot and room information directly from the package, streamlining development and reducing the need for manual retrieval or computation of these details.
</aside>