Defer reply on inventory
All checks were successful
Deploy To Stage / build (push) Successful in 9s
Deploy To Stage / deploy (push) Successful in 15s

This commit is contained in:
Ethan Lane 2024-06-28 18:53:15 +01:00
parent a0a864ef44
commit 5d44c46222
2 changed files with 7 additions and 3 deletions

View file

@ -11,6 +11,8 @@ export default class Inventory extends ButtonEvent {
const page = interaction.customId.split(" ")[2]; const page = interaction.customId.split(" ")[2];
AppLogger.LogSilly("Button/Inventory", `Parameters: userid=${userid}, page=${page}`); 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); 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)); const embed = await InventoryHelper.GenerateInventoryPage(member.user.username, member.user.id, Number(page));
await interaction.update({ await interaction.followUp({
files: [ embed.image ], files: [ embed.image ],
embeds: [ embed.embed ], embeds: [ embed.embed ],
components: [ embed.row ], components: [ embed.row ],

View file

@ -26,6 +26,8 @@ export default class Inventory extends Command {
const user = userOption ? userOption.user! : interaction.user; const user = userOption ? userOption.user! : interaction.user;
await interaction.deferReply();
AppLogger.LogSilly("Commands/Inventory", `Parameters: page=${page?.value}, user=${user.id}`); AppLogger.LogSilly("Commands/Inventory", `Parameters: page=${page?.value}, user=${user.id}`);
try { try {
@ -37,7 +39,7 @@ export default class Inventory extends Command {
const embed = await InventoryHelper.GenerateInventoryPage(user.username, user.id, pageNumber); const embed = await InventoryHelper.GenerateInventoryPage(user.username, user.id, pageNumber);
await interaction.reply({ await interaction.followUp({
files: [ embed.image ], files: [ embed.image ],
embeds: [ embed.embed ], embeds: [ embed.embed ],
components: [ embed.row ], components: [ embed.row ],
@ -45,7 +47,7 @@ export default class Inventory extends Command {
} catch (e) { } catch (e) {
AppLogger.LogError("Commands/Inventory", e as string); AppLogger.LogError("Commands/Inventory", e as string);
await interaction.reply("No page for user found."); await interaction.followUp("No page for user found.");
} }
} }
} }