mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
add getGuild function
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
|||||||
PositionSwap,
|
PositionSwap,
|
||||||
PruneOptions,
|
PruneOptions,
|
||||||
PrunePayload,
|
PrunePayload,
|
||||||
|
UpdateGuildPayload,
|
||||||
UserPayload,
|
UserPayload,
|
||||||
} from "../types/guild.ts";
|
} from "../types/guild.ts";
|
||||||
import { MemberCreatePayload } from "../types/member.ts";
|
import { MemberCreatePayload } from "../types/member.ts";
|
||||||
@@ -607,3 +608,14 @@ export function getWebhooks(guildID: string) {
|
|||||||
export function getUser(userID: string) {
|
export function getUser(userID: string) {
|
||||||
return RequestManager.get(endpoints.USER(userID)) as Promise<UserPayload>;
|
return RequestManager.get(endpoints.USER(userID)) as Promise<UserPayload>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ⚠️ **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 function getGuild(guildID: string, counts = true) {
|
||||||
|
return RequestManager.get(endpoints.GUILD(guildID), { with_counts: counts }) as Promise<UpdateGuildPayload>
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user