mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
get raw user
This commit is contained in:
@@ -94,6 +94,7 @@ export const endpoints = {
|
||||
WEBHOOK_ID: (id: string) => `${baseEndpoints.BASE_URL}/webhooks/${id}`,
|
||||
|
||||
// User endpoints
|
||||
USER: (id: string) => `${baseEndpoints.BASE_URL}/users/${id}`,
|
||||
USER_AVATAR: (id: string, icon: string) =>
|
||||
`${baseEndpoints.CDN_URL}/avatars/${id}/${icon}`,
|
||||
USER_DEFAULT_AVATAR: (icon: number) =>
|
||||
|
||||
@@ -29,6 +29,7 @@ import {
|
||||
PrunePayload,
|
||||
ChannelCreateOptions,
|
||||
BannedUser,
|
||||
UserPayload,
|
||||
} from "../types/guild.ts";
|
||||
import { RoleData } from "../types/role.ts";
|
||||
import { createRole } from "../structures/role.ts";
|
||||
@@ -622,3 +623,8 @@ export function getWebhooks(guildID: string) {
|
||||
|
||||
return RequestManager.get(endpoints.GUILD_WEBHOOKS(guildID));
|
||||
}
|
||||
|
||||
/** This function will return the raw user payload in the rare cases you need to fetch a user directly from the API. */
|
||||
export function getUser(userID: string) {
|
||||
return RequestManager.get(endpoints.USER(userID)) as Promise<UserPayload>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user