The method items.buy(item_id)
is used to purchase items from the shop. You can only buy items that cost 0 bubbles, are free to use, or are purchased with gold and exclusively found in the shop. The bot cannot initiate trades, exchange items with players, or purchase items from the market.
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "buy") {
bot.items.buy("eye-n_basic2018malesquaresleepy").then((res) => {
console.log(res);
}).catch(e => console.error(e));
}
});
The items.buy
method accepts one parameter, which is the item ID. Ensure that you provide the correct item ID; otherwise, the bot will return a server error. Additionally, the bot cannot purchase items based on their name; you must specify the item ID.
This method is useful for acquiring new items from the shop to expand the bot's inventory.