Update swap_channels.ts

This commit is contained in:
ITOH
2021-04-23 23:27:43 +02:00
parent 281416de36
commit e9a46f03cc
+2 -4
View File
@@ -6,16 +6,14 @@ import { endpoints } from "../../util/constants.ts";
export async function swapChannels(
guildId: string,
channelPositions: ModifyGuildChannelPositions[],
): Promise<undefined> {
) {
if (channelPositions.length < 2) {
throw "You must provide at least two channels to be swapped.";
}
const result = await rest.runMethod(
return await rest.runMethod<undefined>(
"patch",
endpoints.GUILD_CHANNELS(guildId),
channelPositions,
);
return result;
}