Compare commits
No commits in common. "7944b3aeac223ae8c0468fc151c5b11cfd51e336" and "0e1bc43ac444a0f261d362514638b1f9576e0b36" have entirely different histories.
7944b3aeac
...
0e1bc43ac4
3 changed files with 1 additions and 51 deletions
|
@ -1,33 +0,0 @@
|
|||
import {ButtonInteraction} from "discord.js";
|
||||
import {ButtonEvent} from "../type/buttonEvent";
|
||||
import EffectHelper from "../helpers/EffectHelper";
|
||||
|
||||
export default class Effects extends ButtonEvent {
|
||||
public override async execute(interaction: ButtonInteraction) {
|
||||
const action = interaction.customId.split(" ")[1];
|
||||
|
||||
switch (action) {
|
||||
case "list":
|
||||
await this.List(interaction);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private async List(interaction: ButtonInteraction) {
|
||||
const pageOption = interaction.customId.split(" ")[2];
|
||||
|
||||
const page = Number(pageOption);
|
||||
|
||||
if (!page) {
|
||||
await interaction.reply("Page option is not a valid number");
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await EffectHelper.GenerateEffectEmbed(interaction.user.id, page);
|
||||
|
||||
await interaction.update({
|
||||
embeds: [ result.embed ],
|
||||
components: [ result.row ],
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
import {CommandInteraction, SlashCommandBuilder} from "discord.js";
|
||||
import {Command} from "../type/command";
|
||||
import EffectHelper from "../helpers/EffectHelper";
|
||||
|
||||
export default class Effects extends Command {
|
||||
constructor() {
|
||||
|
@ -11,11 +10,7 @@ export default class Effects extends Command {
|
|||
.setDescription("Effects")
|
||||
.addSubcommand(x => x
|
||||
.setName("list")
|
||||
.setDescription("List all effects I have")
|
||||
.addNumberOption(x => x
|
||||
.setName("page")
|
||||
.setDescription("The page number")
|
||||
.setMinValue(1)));
|
||||
.setDescription("List all effects I have"));
|
||||
}
|
||||
|
||||
public override async execute(interaction: CommandInteraction) {
|
||||
|
@ -31,15 +26,5 @@ export default class Effects extends Command {
|
|||
}
|
||||
|
||||
private async List(interaction: CommandInteraction) {
|
||||
const pageOption = interaction.options.get("page");
|
||||
|
||||
const page = pageOption && Number(pageOption.value) ? Number(pageOption.value) : 1;
|
||||
|
||||
const result = await EffectHelper.GenerateEffectEmbed(interaction.user.id, page);
|
||||
|
||||
await interaction.reply({
|
||||
embeds: [ result.embed ],
|
||||
components: [ result.row ],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import Droprarity from "./commands/stage/droprarity";
|
|||
|
||||
// Button Event Imports
|
||||
import Claim from "./buttonEvents/Claim";
|
||||
import EffectsButtonEvent from "./buttonEvents/Effects";
|
||||
import InventoryButtonEvent from "./buttonEvents/Inventory";
|
||||
import MultidropButtonEvent from "./buttonEvents/Multidrop";
|
||||
import Reroll from "./buttonEvents/Reroll";
|
||||
|
@ -66,7 +65,6 @@ export default class Registry {
|
|||
|
||||
public static RegisterButtonEvents() {
|
||||
CoreClient.RegisterButtonEvent("claim", new Claim());
|
||||
CoreClient.RegisterButtonEvent("effects", new EffectsButtonEvent());
|
||||
CoreClient.RegisterButtonEvent("inventory", new InventoryButtonEvent());
|
||||
CoreClient.RegisterButtonEvent("multidrop", new MultidropButtonEvent());
|
||||
CoreClient.RegisterButtonEvent("reroll", new Reroll());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue