The method inventory.get()
is used to retrieve the bot's inventory. It returns a list of items in the bot's inventory, including their names and IDs. This inventory can be used to obtain information about available items and their respective IDs, which can then be used to dress up the bot with specific items.
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "inventory") {
bot.inventory.get().then((inventory) => {
console.log(inventory);
}).catch(e => console.error(e));
}
});
This method will return the bot's inventory, providing information about each item, such as its name and ID. This information can be utilized to dress up the bot with specific items or perform other actions based on the inventory contents.
Example Output:
[
{
type: 'clothing',
amount: 1,
id: 'shirt-n_room32019denimjackethoodie',
account_bound: false,
active_palette: 0
},
{
type: 'clothing',
amount: 1,
id: 'pants-n_starteritems2019cuffedjeanswhite',
account_bound: false,
active_palette: 0
},
{
type: 'clothing',
amount: 1,
id: 'shoes-n_room32019socksneakersgrey',
account_bound: false,
active_palette: 0
}
]