Add new multi-use !info command
This commit is contained in:
parent
7ad2458fd9
commit
106a959b4d
7 changed files with 184 additions and 61 deletions
9
backend/src/plugins/Utility/functions/getGuildPreview.ts
Normal file
9
backend/src/plugins/Utility/functions/getGuildPreview.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { Client, GuildPreview } from "eris";
|
||||
import { memoize, MINUTES } from "../../../utils";
|
||||
|
||||
/**
|
||||
* Memoized getGuildPreview
|
||||
*/
|
||||
export function getGuildPreview(client: Client, guildId: string): Promise<GuildPreview | null> {
|
||||
return memoize(() => client.getGuildPreview(guildId).catch(() => null), `getGuildPreview_${guildId}`, 10 * MINUTES);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue