Compare commits
No commits in common. "9fce79579baee90688064c0375c83f2ccf41519f" and "d7a5472759469529201cfa803f9ba87c8dbcb5dd" have entirely different histories.
9fce79579b
...
d7a5472759
4 changed files with 0 additions and 54 deletions
|
@ -1,18 +0,0 @@
|
||||||
import {CommandInteraction, SlashCommandBuilder} from "discord.js";
|
|
||||||
import {Command} from "../type/command";
|
|
||||||
|
|
||||||
export default class Effects extends Command {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.CommandBuilder = new SlashCommandBuilder()
|
|
||||||
.setName("effects")
|
|
||||||
.setDescription("Effects")
|
|
||||||
.addSubcommand(x => x
|
|
||||||
.setName("list")
|
|
||||||
.setDescription("List all effects I have"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override async execute(interaction: CommandInteraction) {
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -57,19 +57,4 @@ export default class UserEffect extends AppBaseEntity {
|
||||||
|
|
||||||
return single;
|
return single;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async FetchAllByUserIdPaginated(userId: string, page: number = 0): Promise<UserEffect[]> {
|
|
||||||
const itemsPerPage = 10;
|
|
||||||
|
|
||||||
const repository = AppDataSource.getRepository(UserEffect);
|
|
||||||
|
|
||||||
const all = await repository.find({
|
|
||||||
where: { UserId: userId },
|
|
||||||
order: { Name: "ASC" },
|
|
||||||
skip: page * itemsPerPage,
|
|
||||||
take: itemsPerPage,
|
|
||||||
});
|
|
||||||
|
|
||||||
return all;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import {EmbedBuilder} from "discord.js";
|
|
||||||
import UserEffect from "../database/entities/app/UserEffect";
|
import UserEffect from "../database/entities/app/UserEffect";
|
||||||
import EmbedColours from "../constants/EmbedColours";
|
|
||||||
|
|
||||||
export default class EffectHelper {
|
export default class EffectHelper {
|
||||||
public static async AddEffectToUserInventory(userId: string, name: string, quantity: number = 1) {
|
public static async AddEffectToUserInventory(userId: string, name: string, quantity: number = 1) {
|
||||||
|
@ -48,21 +46,4 @@ export default class EffectHelper {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async GenerateEffectEmbed(userId: string, page: number): Promise<EmbedBuilder> {
|
|
||||||
const effects = await UserEffect.FetchAllByUserIdPaginated(userId, page - 1);
|
|
||||||
|
|
||||||
let description = "*none*";
|
|
||||||
|
|
||||||
if (effects.length > 0) {
|
|
||||||
description = effects.map(x => `${x.Name} x${x.Unused}`).join("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
|
||||||
.setTitle("Effects")
|
|
||||||
.setDescription(description)
|
|
||||||
.setColor(EmbedColours.Ok);
|
|
||||||
|
|
||||||
return embed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import AllBalance from "./commands/allbalance";
|
||||||
import Balance from "./commands/balance";
|
import Balance from "./commands/balance";
|
||||||
import Daily from "./commands/daily";
|
import Daily from "./commands/daily";
|
||||||
import Drop from "./commands/drop";
|
import Drop from "./commands/drop";
|
||||||
import Effects from "./commands/effects";
|
|
||||||
import Gdrivesync from "./commands/gdrivesync";
|
import Gdrivesync from "./commands/gdrivesync";
|
||||||
import Give from "./commands/give";
|
import Give from "./commands/give";
|
||||||
import Id from "./commands/id";
|
import Id from "./commands/id";
|
||||||
|
@ -45,7 +44,6 @@ export default class Registry {
|
||||||
CoreClient.RegisterCommand("balance", new Balance());
|
CoreClient.RegisterCommand("balance", new Balance());
|
||||||
CoreClient.RegisterCommand("daily", new Daily());
|
CoreClient.RegisterCommand("daily", new Daily());
|
||||||
CoreClient.RegisterCommand("drop", new Drop());
|
CoreClient.RegisterCommand("drop", new Drop());
|
||||||
CoreClient.RegisterCommand("effects", new Effects());
|
|
||||||
CoreClient.RegisterCommand("gdrivesync", new Gdrivesync());
|
CoreClient.RegisterCommand("gdrivesync", new Gdrivesync());
|
||||||
CoreClient.RegisterCommand("give", new Give());
|
CoreClient.RegisterCommand("give", new Give());
|
||||||
CoreClient.RegisterCommand("id", new Id());
|
CoreClient.RegisterCommand("id", new Id());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue