mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
refactor(helpers): separate functions into files (#667)
* refactor(helpers): separate functions into files * idk * idk
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { RequestManager } from "../../rest/request_manager.ts";
|
||||
import { UpdateGuildPayload } from "../../types/mod.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/**
|
||||
* ⚠️ **If you need this, you are probably doing something wrong. Always use cache.guilds.get()
|
||||
*
|
||||
* Advanced Devs:
|
||||
* This function fetches a guild's data. This is not the same data as a GUILD_CREATE.
|
||||
* So it does not cache the guild, you must do it manually.
|
||||
* */
|
||||
export async function getGuild(guildID: string, counts = true) {
|
||||
const result = await RequestManager.get(endpoints.GUILDS_BASE(guildID), {
|
||||
with_counts: counts,
|
||||
});
|
||||
|
||||
return result as UpdateGuildPayload;
|
||||
}
|
||||
Reference in New Issue
Block a user