mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-17 19:58:18 +00:00
5f1b82a4e8
* fix(rest/process_request): use DiscordHTTPResponseCodes * refactor: remove RequestManager * refactor: remove RequestManager and use runMethod()
16 lines
581 B
TypeScript
16 lines
581 B
TypeScript
import { rest } from "../../rest/rest.ts";
|
|
import { endpoints } from "../../util/constants.ts";
|
|
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
|
|
|
/** Returns a list of role objects for the guild.
|
|
*
|
|
* ⚠️ **If you need this, you are probably doing something wrong. This is not intended for use. Your roles will be cached in your guild.**
|
|
*/
|
|
export async function getRoles(guildId: string) {
|
|
await requireBotGuildPermissions(guildId, ["MANAGE_ROLES"]);
|
|
|
|
const result = await rest.runMethod("get", endpoints.GUILD_ROLES(guildId));
|
|
|
|
return result;
|
|
}
|