async def edit(self, *, reason=None, **options):
try:<EOL><INDENT>position = options.pop('<STR_LIT>')<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>await self._move(position, reason=reason)<EOL>self.position = position<EOL><DEDENT>if options:<EOL><INDENT>data = await self._state.http.edit_channel(self.id, reason=reason, **options)<EOL>self._update(self.guild, data)<EOL><DEDENT>
|coro|

        Edits the channel.

        You must have the :attr:`~Permissions.manage_channels` permission to
        use this.

        Parameters
        ----------
        name: :class:`str`
            The new category's name.
        position: :class:`int`
            The new category's position.
        nsfw: :class:`bool`
            To mark the category as NSFW or not.
        reason: Optional[:class:`str`]
            The reason for editing this category. Shows up on the audit log.

        Raises
        ------
        InvalidArgument
            If position is less than 0 or greater than the number of categories.
        Forbidden
            You do not have permissions to edit the category.
        HTTPException
            Editing the category failed.