mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
13 lines
400 B
TypeScript
13 lines
400 B
TypeScript
import { Client, GuildPreview, Snowflake } from "discord.js";
|
|
import { memoize, MINUTES } from "../../../utils";
|
|
|
|
/**
|
|
* Memoized getGuildPreview
|
|
*/
|
|
export function getGuildPreview(client: Client, guildId: string): Promise<GuildPreview | null> {
|
|
return memoize(
|
|
() => client.fetchGuildPreview(guildId as Snowflake).catch(() => null),
|
|
`getGuildPreview_${guildId}`,
|
|
10 * MINUTES,
|
|
);
|
|
}
|