mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Update swap_channels.ts
This commit is contained in:
@@ -6,16 +6,14 @@ import { endpoints } from "../../util/constants.ts";
|
|||||||
export async function swapChannels(
|
export async function swapChannels(
|
||||||
guildId: string,
|
guildId: string,
|
||||||
channelPositions: ModifyGuildChannelPositions[],
|
channelPositions: ModifyGuildChannelPositions[],
|
||||||
): Promise<undefined> {
|
) {
|
||||||
if (channelPositions.length < 2) {
|
if (channelPositions.length < 2) {
|
||||||
throw "You must provide at least two channels to be swapped.";
|
throw "You must provide at least two channels to be swapped.";
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await rest.runMethod(
|
return await rest.runMethod<undefined>(
|
||||||
"patch",
|
"patch",
|
||||||
endpoints.GUILD_CHANNELS(guildId),
|
endpoints.GUILD_CHANNELS(guildId),
|
||||||
channelPositions,
|
channelPositions,
|
||||||
);
|
);
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user