async def edit(self, *, reason=None, **fields):
http = self._state.http<EOL>guild_id = self.guild.id<EOL>payload = {}<EOL>try:<EOL><INDENT>nick = fields['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>nick = nick if nick else '<STR_LIT>'<EOL>if self._state.self_id == self.id:<EOL><INDENT>await http.change_my_nickname(guild_id, nick, reason=reason)<EOL><DEDENT>else:<EOL><INDENT>payload['<STR_LIT>'] = nick<EOL><DEDENT><DEDENT>deafen = fields.get('<STR_LIT>')<EOL>if deafen is not None:<EOL><INDENT>payload['<STR_LIT>'] = deafen<EOL><DEDENT>mute = fields.get('<STR_LIT>')<EOL>if mute is not None:<EOL><INDENT>payload['<STR_LIT>'] = mute<EOL><DEDENT>try:<EOL><INDENT>vc = fields['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>payload['<STR_LIT>'] = vc.id<EOL><DEDENT>try:<EOL><INDENT>roles = fields['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>payload['<STR_LIT>'] = tuple(r.id for r in roles)<EOL><DEDENT>await http.edit_member(guild_id, self.id, reason=reason, **payload)<EOL>
|coro|

        Edits the member's data.

        Depending on the parameter passed, this requires different permissions listed below:

        +---------------+--------------------------------------+
        |   Parameter   |              Permission              |
        +---------------+--------------------------------------+
        | nick          | :attr:`Permissions.manage_nicknames` |
        +---------------+--------------------------------------+
        | mute          | :attr:`Permissions.mute_members`     |
        +---------------+--------------------------------------+
        | deafen        | :attr:`Permissions.deafen_members`   |
        +---------------+--------------------------------------+
        | roles         | :attr:`Permissions.manage_roles`     |
        +---------------+--------------------------------------+
        | voice_channel | :attr:`Permissions.move_members`     |
        +---------------+--------------------------------------+

        All parameters are optional.

        Parameters
        -----------
        nick: Optional[:class:`str`]
            The member's new nickname. Use ``None`` to remove the nickname.
        mute: Optional[:class:`bool`]
            Indicates if the member should be guild muted or un-muted.
        deafen: Optional[:class:`bool`]
            Indicates if the member should be guild deafened or un-deafened.
        roles: Optional[List[:class:`Roles`]]
            The member's new list of roles. This *replaces* the roles.
        voice_channel: Optional[:class:`VoiceChannel`]
            The voice channel to move the member to.
        reason: Optional[:class:`str`]
            The reason for editing this member. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have the proper permissions to the action requested.
        HTTPException
            The operation failed.