The method wallet.boost.buy()
is used to purchase boost tokens using the bot's wallet. It requires specifying the priority of the bot's wallet. After purchasing the boost tokens, the bot automatically boosts the room.
Note: When buying boost and voice tokens, the bot will automatically start a boost or voice chat session in the room rather than just purchasing the tokens.
const { Prioreties } = require("highrise.sdk");
// Assuming you have defined the Highrise instance as "bot".
bot.on("chatCreate", async (user, message) => {
if (message === "buy boost") {
bot.wallet.boost.buy(Priorities.BotWalletOnly).then(() => {
console.log("The bot has successfully boosted the room");
}).catch(e => console.error(e));
}
});
Go Back: Buy & Fetch Wallet