Method ModifyPositionInCategorySmartAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
ModifyPositionInCategorySmartAsync(string, int, string)
Updates the channel position within it's own category. Valid modes: '+' or 'down' to move a channel down | '-' or 'up' to move a channel up.
Use ModifyParentAsync(DiscordChannel, bool?, string) for moving to other categories. Use RemoveParentAsync(string) to move out of a category. Use ModifyPositionAsync(int, string) to move channels outside a category.
public Task ModifyPositionInCategorySmartAsync(string mode, int position, string reason = null)
Parameters
mode
stringThe mode. Valid: '+' or 'down' to move a channel down | '-' or 'up' to move a channel up
position
intThe position.
reason
stringThe reason.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the ManageChannels permission.
- NotFoundException
Thrown when the channel does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
- IndexOutOfRangeException
Thrown when
position
is out of range.- ArgumentException
Thrown when function is called on a channel without a parent channel, a wrong mode is given or given position is zero.