Create series command #190

Merged
Vylpes merged 5 commits from feature/99-series-command into develop 2024-03-31 15:49:30 +01:00
3 changed files with 5 additions and 2 deletions
Showing only changes of commit 9e2e2abce3 - Show all commits

View file

@ -10,7 +10,7 @@ export default class Series extends Command {
super(); super();
this.CommandBuilder = new SlashCommandBuilder() this.CommandBuilder = new SlashCommandBuilder()
.setName("view") .setName("series")
.setDescription("View details on a series") .setDescription("View details on a series")
.addSubcommand(x => .addSubcommand(x =>
x x

View file

@ -3,6 +3,7 @@ import AppLogger from "../client/appLogger";
import cloneDeep from "clone-deep"; import cloneDeep from "clone-deep";
import { CoreClient } from "../client/client"; import { CoreClient } from "../client/client";
import EmbedColours from "../constants/EmbedColours"; import EmbedColours from "../constants/EmbedColours";
import { CardRarityToString } from "../constants/CardRarity";
export default class SeriesHelper { export default class SeriesHelper {
public static GenerateSeriesViewPage(seriesId: number, page: number): { embed: EmbedBuilder, row: ActionRowBuilder<ButtonBuilder> } | null { public static GenerateSeriesViewPage(seriesId: number, page: number): { embed: EmbedBuilder, row: ActionRowBuilder<ButtonBuilder> } | null {
@ -28,7 +29,7 @@ export default class SeriesHelper {
const cardsOnPage = series.cards.splice(page * itemsPerPage, itemsPerPage); const cardsOnPage = series.cards.splice(page * itemsPerPage, itemsPerPage);
const description = cardsOnPage const description = cardsOnPage
.map(x => `[${x.id}] ${x.name}`) .map(x => `[${x.id}] ${x.name} ${CardRarityToString(x.type).toUpperCase()}`)
.join("\n"); .join("\n");
const embed = new EmbedBuilder() const embed = new EmbedBuilder()

View file

@ -20,6 +20,7 @@ import Droprarity from "./commands/stage/droprarity";
import Claim from "./buttonEvents/Claim"; import Claim from "./buttonEvents/Claim";
import InventoryButtonEvent from "./buttonEvents/Inventory"; import InventoryButtonEvent from "./buttonEvents/Inventory";
import Reroll from "./buttonEvents/Reroll"; import Reroll from "./buttonEvents/Reroll";
import SeriesEvent from "./buttonEvents/Series";
import TradeButtonEvent from "./buttonEvents/Trade"; import TradeButtonEvent from "./buttonEvents/Trade";
export default class Registry { export default class Registry {
@ -48,6 +49,7 @@ export default class Registry {
CoreClient.RegisterButtonEvent("claim", new Claim()); CoreClient.RegisterButtonEvent("claim", new Claim());
CoreClient.RegisterButtonEvent("inventory", new InventoryButtonEvent()); CoreClient.RegisterButtonEvent("inventory", new InventoryButtonEvent());
CoreClient.RegisterButtonEvent("reroll", new Reroll()); CoreClient.RegisterButtonEvent("reroll", new Reroll());
CoreClient.RegisterButtonEvent("series", new SeriesEvent());
CoreClient.RegisterButtonEvent("trade", new TradeButtonEvent()); CoreClient.RegisterButtonEvent("trade", new TradeButtonEvent());
} }
} }