mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
tests: add roles tests (#822)
This commit is contained in:
@@ -22,7 +22,7 @@ export async function createRole(
|
||||
});
|
||||
|
||||
const roleData = result as RoleData;
|
||||
const role = await structures.createDiscordenoRole(roleData);
|
||||
const role = await structures.createDiscordenoRole({role: roleData, guild_id: guildId});
|
||||
const guild = await cacheHandlers.get("guilds", guildId);
|
||||
guild?.roles.set(role.id, role);
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
||||
|
||||
/** Modify the positions of a set of role objects for the guild. Requires the MANAGE_ROLES permission. */
|
||||
export async function swapRoles(guildId: string, rolePositons: PositionSwap) {
|
||||
export async function swapRoles(guildId: string, rolePositions: PositionSwap) {
|
||||
await requireBotGuildPermissions(guildId, ["MANAGE_ROLES"]);
|
||||
|
||||
const result = await rest.runMethod(
|
||||
"patch",
|
||||
endpoints.GUILD_ROLES(guildId),
|
||||
rolePositons,
|
||||
rolePositions,
|
||||
);
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user