Add list moons command #449

Merged
Vylpes merged 15 commits from feature/195-list-moons into develop 2024-08-17 16:47:14 +01:00
2 changed files with 3 additions and 4 deletions
Showing only changes of commit 736cbe0ac1 - Show all commits

View file

@ -4,7 +4,7 @@ import List from "./moons/list";
export default class Moons extends ButtonEvent { export default class Moons extends ButtonEvent {
public override async execute(interaction: ButtonInteraction): Promise<void> { public override async execute(interaction: ButtonInteraction): Promise<void> {
const action = interaction.customId.split(" ")[0]; const action = interaction.customId.split(" ")[1];
switch (action) { switch (action) {
case "list": case "list":

View file

@ -5,11 +5,10 @@ import EmbedColours from "../../constants/EmbedColours";
export default async function List(interaction: ButtonInteraction) { export default async function List(interaction: ButtonInteraction) {
if (!interaction.guild) return; if (!interaction.guild) return;
const userId = interaction.customId.split(" ")[1]; const userId = interaction.customId.split(" ")[2];
const page = interaction.customId.split(" ")[2]; const page = interaction.customId.split(" ")[3];
if (!userId || !page) return; if (!userId || !page) return;
if (!Number(page)) return;
const pageNumber = Number(page); const pageNumber = Number(page);