Method ModifyParentAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
ModifyParentAsync(DiscordChannel, bool?, string, CancellationToken)
Updates the channel parent, moving the channel to the bottom of the new category.
public Task ModifyParentAsync(DiscordChannel newParent, bool? lockPermissions = null, string reason = null, CancellationToken cancellationToken = default)
Parameters
newParentDiscordChannelNew parent for channel. Use RemoveParentAsync(string, CancellationToken) to remove from parent.
lockPermissionsbool?Sync permissions with parent. Defaults to null.
reasonstringReason for audit logs.
cancellationTokenCancellationTokenA token to cancel the request.
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.