function setPosition

export function setPosition<Item extends Channel | Role>( item: Item, position: number, relative: boolean, sorted: Collection<Snowflake, Item>, client: Client<true>, route: string, reason?: string,): Promise<{ id: Snowflake; position: number }[]>;

Sets the position of a Channel or Role.

Returns: Updated item list, with id and position properties

Type Parameters

Item extends Channel | Role


item: Item
Object to set the position of
position: number
New position for the object
relative: boolean
Whether position is relative to its current position
sorted: Collection<Snowflake, Item>
A collection of the objects sorted properly
client: Client<true>
The client to use to patch the data
route: string
Route to call PATCH on
reason?: string
Reason for the change