Use the built-in defer reply method
This commit is contained in:
@ -51,16 +51,20 @@ async function execute(interaction) {
|
||||
}
|
||||
};
|
||||
|
||||
// Show "Bot is thinking..."
|
||||
await interaction.deferReply();
|
||||
|
||||
// Kick off the buy request
|
||||
const buyPromise = noblox.buy({product: productInfo, price: 0});
|
||||
const mapValidatePromise = validateMapAsset(id, game);
|
||||
|
||||
const message = await interaction.reply("⌛ Validating map...");
|
||||
|
||||
const validation = await mapValidatePromise;
|
||||
// Validate and send the validation result
|
||||
const validation = await validateMapAsset(id, game);
|
||||
const msg = getValidationMessage(validation, game, false);
|
||||
await message.edit(msg);
|
||||
await interaction.editReply(msg);
|
||||
|
||||
// Make sure the buy request is done
|
||||
await buyPromise;
|
||||
|
||||
await interaction.followUp(
|
||||
`
|
||||
Now that your [map (id: ${id})](<https://create.roblox.com/store/asset/${id}/>) has been taken by the bot you can load it into the [${game} maptest place](<${gamePlaces[game]}>).
|
||||
|
Reference in New Issue
Block a user