Skip to content

Commit fcb664c

Browse files
committed
refactor: rewrite cache plugin apis
1 parent 7f8cb4a commit fcb664c

16 files changed

+791
-805
lines changed

apps/test-bot/src/app/commands/invalidate-random.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { revalidate } from '@commandkit/cache';
1+
import { revalidateTag } from '@commandkit/cache';
22
import { ChatInputCommandContext, CommandData } from 'commandkit';
33

44
export const command: CommandData = {
@@ -9,9 +9,9 @@ export const command: CommandData = {
99
export async function chatInput({ interaction }: ChatInputCommandContext) {
1010
await interaction.deferReply();
1111

12-
const revalidated = await revalidate<number>('random');
12+
await revalidateTag('random');
1313

1414
return interaction.editReply({
15-
content: `Random value has been revalidated. The new value will be ${revalidated}`,
15+
content: `Random value has been revalidated.`,
1616
});
1717
}

apps/test-bot/src/app/events/messageCreate/give-xp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Message } from 'discord.js';
22
import { database } from '../../../database/store.ts';
3-
import { invalidate } from '@commandkit/cache';
3+
import { revalidateTag } from '@commandkit/cache';
44

55
export default async function (message: Message) {
66
if (message.author.bot || !message.inGuild()) return;
@@ -12,5 +12,5 @@ export default async function (message: Message) {
1212
const newXp = oldXp + xp;
1313

1414
await database.set(key, newXp);
15-
await invalidate(key);
15+
await revalidateTag(key);
1616
}

0 commit comments

Comments
 (0)