mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
fix: more missing typings and remove swap roles
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { DiscordUser } from "../../types/users/user.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
@@ -13,7 +14,7 @@ export async function getReactions(
|
||||
"get",
|
||||
endpoints.CHANNEL_MESSAGE_REACTION(channelId, messageId, reaction),
|
||||
options,
|
||||
)) as UserPayload[];
|
||||
)) as DiscordUser[];
|
||||
|
||||
return new Collection(users.map((user) => [user.id, user]));
|
||||
}
|
||||
|
||||
@@ -96,7 +96,6 @@ import { deleteRole } from "./roles/delete_role.ts";
|
||||
import { editRole } from "./roles/edit_role.ts";
|
||||
import { getRoles } from "./roles/get_roles.ts";
|
||||
import { removeRole } from "./roles/remove_role.ts";
|
||||
import { swapRoles } from "./roles/swap_roles.ts";
|
||||
import { createGuildFromTemplate } from "./templates/create_guild_from_template.ts";
|
||||
import { createGuildTemplate } from "./templates/create_guild_template.ts";
|
||||
import { deleteGuildTemplate } from "./templates/delete_guild_template.ts";
|
||||
@@ -230,7 +229,6 @@ export {
|
||||
sendMessage,
|
||||
startTyping,
|
||||
swapChannels,
|
||||
swapRoles,
|
||||
syncGuildTemplate,
|
||||
syncIntegration,
|
||||
unban,
|
||||
@@ -350,7 +348,6 @@ export let helpers = {
|
||||
editRole,
|
||||
getRoles,
|
||||
removeRole,
|
||||
swapRoles,
|
||||
// templates
|
||||
createGuildFromTemplate,
|
||||
createGuildTemplate,
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
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, rolePositions: PositionSwap) {
|
||||
await requireBotGuildPermissions(guildId, ["MANAGE_ROLES"]);
|
||||
|
||||
const result = await rest.runMethod(
|
||||
"patch",
|
||||
endpoints.GUILD_ROLES(guildId),
|
||||
rolePositions,
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user