mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
5f1b82a4e8
* fix(rest/process_request): use DiscordHTTPResponseCodes * refactor: remove RequestManager * refactor: remove RequestManager and use runMethod()
18 lines
591 B
TypeScript
18 lines
591 B
TypeScript
import { rest } from "../../rest/rest.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 rest.runMethod("get", endpoints.GUILDS_BASE(guildId), {
|
|
with_counts: counts,
|
|
});
|
|
|
|
return result as UpdateGuildPayload;
|
|
}
|