async def edit(self, *, reason=None, **fields):
http = self._state.http<EOL>try:<EOL><INDENT>icon_bytes = fields['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>icon = self.icon<EOL><DEDENT>else:<EOL><INDENT>if icon_bytes is not None:<EOL><INDENT>icon = utils._bytes_to_base64_data(icon_bytes)<EOL><DEDENT>else:<EOL><INDENT>icon = None<EOL><DEDENT><DEDENT>try:<EOL><INDENT>banner_bytes = fields['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>banner = self.banner<EOL><DEDENT>else:<EOL><INDENT>if banner_bytes is not None:<EOL><INDENT>banner = utils._bytes_to_base64_data(banner_bytes)<EOL><DEDENT>else:<EOL><INDENT>banner = None<EOL><DEDENT><DEDENT>try:<EOL><INDENT>vanity_code = fields['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>await http.change_vanity_code(self.id, vanity_code, reason=reason)<EOL><DEDENT>try:<EOL><INDENT>splash_bytes = fields['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>splash = self.splash<EOL><DEDENT>else:<EOL><INDENT>if splash_bytes is not None:<EOL><INDENT>splash = utils._bytes_to_base64_data(splash_bytes)<EOL><DEDENT>else:<EOL><INDENT>splash = None<EOL><DEDENT><DEDENT>fields['<STR_LIT>'] = icon<EOL>fields['<STR_LIT>'] = banner<EOL>fields['<STR_LIT>'] = splash<EOL>try:<EOL><INDENT>default_message_notifications = int(fields.pop('<STR_LIT>'))<EOL><DEDENT>except (TypeError, KeyError):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>fields['<STR_LIT>'] = default_message_notifications<EOL><DEDENT>try:<EOL><INDENT>afk_channel = fields.pop('<STR_LIT>')<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if afk_channel is None:<EOL><INDENT>fields['<STR_LIT>'] = afk_channel<EOL><DEDENT>else:<EOL><INDENT>fields['<STR_LIT>'] = afk_channel.id<EOL><DEDENT><DEDENT>try:<EOL><INDENT>system_channel = fields.pop('<STR_LIT>')<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if system_channel is None:<EOL><INDENT>fields['<STR_LIT>'] = system_channel<EOL><DEDENT>else:<EOL><INDENT>fields['<STR_LIT>'] = system_channel.id<EOL><DEDENT><DEDENT>if '<STR_LIT>' in fields:<EOL><INDENT>if self.owner != self.me:<EOL><INDENT>raise InvalidArgument('<STR_LIT>')<EOL><DEDENT>fields['<STR_LIT>'] = fields['<STR_LIT>'].id<EOL><DEDENT>if '<STR_LIT>' in fields:<EOL><INDENT>fields['<STR_LIT>'] = str(fields['<STR_LIT>'])<EOL><DEDENT>level = fields.get('<STR_LIT>', self.verification_level)<EOL>if not isinstance(level, VerificationLevel):<EOL><INDENT>raise InvalidArgument('<STR_LIT>')<EOL><DEDENT>fields['<STR_LIT>'] = level.value<EOL>explicit_content_filter = fields.get('<STR_LIT>', self.explicit_content_filter)<EOL>if not isinstance(explicit_content_filter, ContentFilter):<EOL><INDENT>raise InvalidArgument('<STR_LIT>')<EOL><DEDENT>fields['<STR_LIT>'] = explicit_content_filter.value<EOL>await http.edit_guild(self.id, reason=reason, **fields)<EOL>
|coro|

        Edits the guild.

        You must have the :attr:`~Permissions.manage_guild` permission
        to edit the guild.

        Parameters
        ----------
        name: :class:`str`
            The new name of the guild.
        description: :class:`str`
            The new description of the guild. This is only available to guilds that
            contain `VERIFIED` in :attr:`Guild.features`.
        icon: :class:`bytes`
            A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG supported.
            Could be ``None`` to denote removal of the icon.
        banner: :class:`bytes`
            A :term:`py:bytes-like object` representing the banner.
            Could be ``None`` to denote removal of the banner.
        splash: :class:`bytes`
            A :term:`py:bytes-like object` representing the invite splash.
            Only PNG/JPEG supported. Could be ``None`` to denote removing the
            splash. Only available for partnered guilds with ``INVITE_SPLASH``
            feature.
        region: :class:`VoiceRegion`
            The new region for the guild's voice communication.
        afk_channel: Optional[:class:`VoiceChannel`]
            The new channel that is the AFK channel. Could be ``None`` for no AFK channel.
        afk_timeout: :class:`int`
            The number of seconds until someone is moved to the AFK channel.
        owner: :class:`Member`
            The new owner of the guild to transfer ownership to. Note that you must
            be owner of the guild to do this.
        verification_level: :class:`VerificationLevel`
            The new verification level for the guild.
        default_notifications: :class:`NotificationLevel`
            The new default notification level for the guild.
        explicit_content_filter: :class:`ContentFilter`
            The new explicit content filter for the guild.
        vanity_code: :class:`str`
            The new vanity code for the guild.
        system_channel: Optional[:class:`TextChannel`]
            The new channel that is used for the system channel. Could be ``None`` for no system channel.
        reason: Optional[:class:`str`]
            The reason for editing this guild. Shows up on the audit log.

        Raises
        -------
        Forbidden
            You do not have permissions to edit the guild.
        HTTPException
            Editing the guild failed.
        InvalidArgument
            The image format passed in to ``icon`` is invalid. It must be
            PNG or JPG. This is also raised if you are not the owner of the
            guild and request an ownership transfer.