Defer reply on inventory
This commit is contained in:
parent
a0a864ef44
commit
5d44c46222
2 changed files with 7 additions and 3 deletions
|
@ -11,6 +11,8 @@ export default class Inventory extends ButtonEvent {
|
|||
const page = interaction.customId.split(" ")[2];
|
||||
|
||||
AppLogger.LogSilly("Button/Inventory", `Parameters: userid=${userid}, page=${page}`);
|
||||
|
||||
await interaction.deferUpdate();
|
||||
|
||||
const member = interaction.guild.members.cache.find(x => x.id == userid) || await interaction.guild.members.fetch(userid);
|
||||
|
||||
|
@ -24,7 +26,7 @@ export default class Inventory extends ButtonEvent {
|
|||
|
||||
const embed = await InventoryHelper.GenerateInventoryPage(member.user.username, member.user.id, Number(page));
|
||||
|
||||
await interaction.update({
|
||||
await interaction.followUp({
|
||||
files: [ embed.image ],
|
||||
embeds: [ embed.embed ],
|
||||
components: [ embed.row ],
|
||||
|
|
|
@ -26,6 +26,8 @@ export default class Inventory extends Command {
|
|||
|
||||
const user = userOption ? userOption.user! : interaction.user;
|
||||
|
||||
await interaction.deferReply();
|
||||
|
||||
AppLogger.LogSilly("Commands/Inventory", `Parameters: page=${page?.value}, user=${user.id}`);
|
||||
|
||||
try {
|
||||
|
@ -37,7 +39,7 @@ export default class Inventory extends Command {
|
|||
|
||||
const embed = await InventoryHelper.GenerateInventoryPage(user.username, user.id, pageNumber);
|
||||
|
||||
await interaction.reply({
|
||||
await interaction.followUp({
|
||||
files: [ embed.image ],
|
||||
embeds: [ embed.embed ],
|
||||
components: [ embed.row ],
|
||||
|
@ -45,7 +47,7 @@ export default class Inventory extends Command {
|
|||
} catch (e) {
|
||||
AppLogger.LogError("Commands/Inventory", e as string);
|
||||
|
||||
await interaction.reply("No page for user found.");
|
||||
await interaction.followUp("No page for user found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue