This commit is contained in:
parent
217eeb01ac
commit
96f1b1ceec
4 changed files with 11 additions and 7 deletions
|
@ -25,6 +25,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.update({
|
||||||
|
files: [ embed.image ],
|
||||||
embeds: [ embed.embed ],
|
embeds: [ embed.embed ],
|
||||||
components: [ embed.row ],
|
components: [ embed.row ],
|
||||||
});
|
});
|
||||||
|
@ -34,4 +35,4 @@ export default class Inventory extends ButtonEvent {
|
||||||
await interaction.reply("No page for user found.");
|
await interaction.reply("No page for user found.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,4 +88,4 @@ export default class Drop extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,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.reply({
|
||||||
|
files: [ embed.image ],
|
||||||
embeds: [ embed.embed ],
|
embeds: [ embed.embed ],
|
||||||
components: [ embed.row ],
|
components: [ embed.row ],
|
||||||
});
|
});
|
||||||
|
@ -47,4 +48,4 @@ export default class Inventory extends Command {
|
||||||
await interaction.reply("No page for user found.");
|
await interaction.reply("No page for user found.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js";
|
import { ActionRowBuilder, AttachmentBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js";
|
||||||
import Inventory from "../database/entities/app/Inventory";
|
import Inventory from "../database/entities/app/Inventory";
|
||||||
import { CoreClient } from "../client/client";
|
import { CoreClient } from "../client/client";
|
||||||
import EmbedColours from "../constants/EmbedColours";
|
import EmbedColours from "../constants/EmbedColours";
|
||||||
|
@ -26,7 +26,7 @@ interface InventoryPageCards {
|
||||||
interface ReturnedInventoryPage {
|
interface ReturnedInventoryPage {
|
||||||
embed: EmbedBuilder,
|
embed: EmbedBuilder,
|
||||||
row: ActionRowBuilder<ButtonBuilder>,
|
row: ActionRowBuilder<ButtonBuilder>,
|
||||||
image: Buffer,
|
image: AttachmentBuilder,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +96,8 @@ export default class InventoryHelper {
|
||||||
.setTitle(username)
|
.setTitle(username)
|
||||||
.setDescription(`**${currentPage.name} (${currentPage.seriesSubpage + 1})**\n${currentPage.cards.map(x => `[${x.id}] ${x.name} (${CardRarityToString(x.type)}) x${x.quantity}`).join("\n")}`)
|
.setDescription(`**${currentPage.name} (${currentPage.seriesSubpage + 1})**\n${currentPage.cards.map(x => `[${x.id}] ${x.name} (${CardRarityToString(x.type)}) x${x.quantity}`).join("\n")}`)
|
||||||
.setFooter({ text: `Page ${page + 1} of ${pages.length}` })
|
.setFooter({ text: `Page ${page + 1} of ${pages.length}` })
|
||||||
.setColor(EmbedColours.Ok);
|
.setColor(EmbedColours.Ok)
|
||||||
|
.setImage("attachment://page.png");
|
||||||
|
|
||||||
const row = new ActionRowBuilder<ButtonBuilder>()
|
const row = new ActionRowBuilder<ButtonBuilder>()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
|
@ -111,7 +112,8 @@ export default class InventoryHelper {
|
||||||
.setStyle(ButtonStyle.Primary)
|
.setStyle(ButtonStyle.Primary)
|
||||||
.setDisabled(page + 1 == pages.length));
|
.setDisabled(page + 1 == pages.length));
|
||||||
|
|
||||||
const image = await this.GenerateInventoryImage(currentPage);
|
const buffer = await this.GenerateInventoryImage(currentPage);
|
||||||
|
const image = new AttachmentBuilder(buffer, { name: "page.png" });
|
||||||
|
|
||||||
return { embed, row, image };
|
return { embed, row, image };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue