Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions apps/discord-bot/src/commands/events/events.command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { EVENT_TYPES, GENERAL_MODES } from "@statsify/schemas";
import { EventsProfile } from "./events.profile.js";
import { arrayGroup } from "@statsify/util";
import { getBackground, getLogo } from "@statsify/assets";
import { getProfileCustomId } from "#commands/base.hypixel-command";
import { getTheme } from "#themes";
import { mapBackground } from "#constants";
import { render } from "@statsify/rendering";
Expand All @@ -29,7 +30,7 @@ export class EventsCommand {
const user = context.getUser();
const t = context.t();

const player = await this.apiService.getPlayer(context.option("player"), user);
const player = await this.apiService.getPlayer(context.option("player"), user, context.getCacheLevel());

const [logo, skin, badge] = await Promise.all([
getLogo(user),
Expand Down Expand Up @@ -57,7 +58,11 @@ export class EventsCommand {
/>,
getTheme(user)
);
})
}),
undefined,
undefined,
false,
getProfileCustomId(context, player.uuid)
);
}
}
6 changes: 5 additions & 1 deletion apps/discord-bot/src/commands/guild/guild.command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import {
paginate,
PlayerArgument,
SubCommand,
createCustomId,
} from "@statsify/discord";
import { GUILD_ROUTE } from "./guild.route.js";
import { GuildListProfile, GuildListProfileProps } from "./guild-list.profile.js";
import { GuildMember } from "@statsify/schemas";
import { GuildMemberProfile } from "./guild-member.profile.js";
Expand Down Expand Up @@ -85,7 +87,9 @@ export class GuildCommand extends GuildTopSubCommand {
label: "Misc",
generator: () => render(<GuildProfile {...props} page="misc" />, getTheme(user)),
},
]);
], (page) =>
createCustomId(GUILD_ROUTE, context.getInteraction().getUserId(), context.getCommandName(), guild.id, page)
);
}

@SubCommand({ description: (t) => t("commands.guild-list"), args: GuildArgument })
Expand Down
3 changes: 2 additions & 1 deletion apps/discord-bot/src/commands/minecraft/cape.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
paginate
} from "@statsify/discord";
import { Image, loadImage } from "skia-canvas";
import { getProfileCustomId } from "#commands/base.hypixel-command";
import { createCanvas } from "@statsify/rendering";
import type { Skin } from "@statsify/schemas";

Expand Down Expand Up @@ -48,7 +49,7 @@ export class CapeCommand {
(t) => t("errors.noCape.description", { username: player.username })
);

return paginate(context, pages);
return paginate(context, pages, getProfileCustomId(context, player.uuid));
}

private async getOptifineCape(username: string) {
Expand Down
5 changes: 3 additions & 2 deletions apps/discord-bot/src/commands/quests/quests.command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
PlayerArgument,
SubCommand,
} from "@statsify/discord";
import { getProfileCustomId } from "#commands/base.hypixel-command";
import { QUEST_MODES, QuestTime } from "@statsify/schemas";
import { QuestProfileProps, QuestsProfile } from "./quests.profile.js";
import { getAllGameIcons, getBackground, getLogo } from "@statsify/assets";
Expand Down Expand Up @@ -67,7 +68,7 @@ export class QuestsCommand {
private async run(context: CommandContext, time: QuestTime) {
const user = context.getUser();

const player = await this.apiService.getPlayer(context.option("player"), user);
const player = await this.apiService.getPlayer(context.option("player"), user, context.getCacheLevel());

const [logo, skin, badge, gameIcons, verifiedLogo, crossLogo] = await Promise.all([
getLogo(user),
Expand Down Expand Up @@ -112,6 +113,6 @@ export class QuestsCommand {
},
}));

return paginate(context, pages);
return paginate(context, pages, getProfileCustomId(context, player.uuid, `quests.${context.getCommandName()}`));
}
}
5 changes: 3 additions & 2 deletions apps/discord-bot/src/commands/ratios/ratios.command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
MODES_TO_FORMATTED,
mapBackground,
} from "#constants";
import { getProfileCustomId } from "#commands/base.hypixel-command";
import { RatiosProfile, RatiosProfileProps } from "./ratios.profile.js";
import { filterMegaWallsKits } from "../megawalls/megawalls.command.js";
import { getBackground, getLogo } from "@statsify/assets";
Expand Down Expand Up @@ -187,7 +188,7 @@ export class RatiosCommand {
filterModes?: (player: Player, modes: GameModeWithSubModes<T>[]) => GameModeWithSubModes<T>[]
) {
const user = context.getUser();
const player = await this.apiService.getPlayer(context.option("player"), user);
const player = await this.apiService.getPlayer(context.option("player"), user, context.getCacheLevel());

const [logo, skin, badge] = await Promise.all([
getLogo(user),
Expand Down Expand Up @@ -242,7 +243,7 @@ export class RatiosCommand {
},
}));

return paginate(context, pages);
return paginate(context, pages, getProfileCustomId(context, player.uuid, `ratios.${context.getCommandName()}`));
}

private getModeStats(game: PlayerStats[keyof PlayerStats], mode: GameModeWithSubModes<any>) {
Expand Down
Loading