mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 11:29:12 +00:00
18 lines
500 B
TypeScript
18 lines
500 B
TypeScript
import { asEditor, getGuild, GuildRateLimiterKey } from '../utils/guild';
|
|
import { notFound, ok } from '../utils/responses';
|
|
|
|
export const ClearGuildCache = asEditor(
|
|
{
|
|
rateLimitKey: GuildRateLimiterKey.cacheClear,
|
|
rateLimitTimeoutSeconds: 60 * 5,
|
|
},
|
|
(session, { guildID }) =>
|
|
async (request: Request): Promise<Response> => {
|
|
const result = await getGuild(guildID, { skipCachePull: true });
|
|
if (!result) {
|
|
return notFound();
|
|
}
|
|
|
|
return ok();
|
|
}
|
|
);
|