fix: more missing typings and remove swap roles

This commit is contained in:
Skillz4Killz
2021-04-12 18:35:24 +00:00
committed by GitHub
parent 79a0c7ae95
commit a741e721f3
5 changed files with 2 additions and 66 deletions
+2 -1
View File
@@ -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]));
}
-3
View File
@@ -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,
-16
View File
@@ -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;
}