Fix button events not working
This commit is contained in:
parent
dc3cb93653
commit
736cbe0ac1
2 changed files with 3 additions and 4 deletions
|
@ -4,7 +4,7 @@ import List from "./moons/list";
|
|||
|
||||
export default class Moons extends ButtonEvent {
|
||||
public override async execute(interaction: ButtonInteraction): Promise<void> {
|
||||
const action = interaction.customId.split(" ")[0];
|
||||
const action = interaction.customId.split(" ")[1];
|
||||
|
||||
switch (action) {
|
||||
case "list":
|
||||
|
|
|
@ -5,11 +5,10 @@ import EmbedColours from "../../constants/EmbedColours";
|
|||
export default async function List(interaction: ButtonInteraction) {
|
||||
if (!interaction.guild) return;
|
||||
|
||||
const userId = interaction.customId.split(" ")[1];
|
||||
const page = interaction.customId.split(" ")[2];
|
||||
const userId = interaction.customId.split(" ")[2];
|
||||
const page = interaction.customId.split(" ")[3];
|
||||
|
||||
if (!userId || !page) return;
|
||||
if (!Number(page)) return;
|
||||
|
||||
const pageNumber = Number(page);
|
||||
|
||||
|
|
Loading…
Reference in a new issue