Repository: Rapptz/discord.py
File: discord/guild.py (Python)

Code before:
            else:
                colors_payload['primary_color'] = actual_primary_colour.value
        if actual_secondary_colour is not MISSING:
            if actual_secondary_colour is None:
                colors_payload['secondary_color'] = None
            elif isinstance(actual_secondary_colour, int):
                colors_payload['secondary_color'] = actual_secondary_colour
            else:
                colors_payload['secondary_color'] = actual_secondary_colour.value
        if actual_tertiary_colour is not MISSING:
            if actual_tertiary_colour is None:
                colors_payload['tertiary_color'] = None
            elif isinstance(actual_tertiary_colour, int):
                colors_payload['tertiary_color'] = actual_tertiary_colour
            else:
                colors_payload['tertiary_color'] = actual_tertiary_colour.value

        if colors_payload:
            fields['colors'] = colors_payload

        if not colors_payload:
            actual_colour = colour or color or Colour.default()
            if isinstance(actual_colour, int):
                fields['color'] = actual_colour
            else:
                fields['color'] = actual_colour.value

        if hoist is not MISSING:
            fields['hoist'] = hoist

        if display_icon is not MISSING:
            if isinstance(display_icon, bytes):
                fields['icon'] = utils._bytes_to_base64_data(display_icon)
            else:
                fields['unicode_emoji'] = display_icon

        if mentionable is not MISSING:
            fields['mentionable'] = mentionable

        if name is not MISSING:
            fields['name'] = name

        data = await self._state.http.create_role(self.id, reason=reason, **fields)
        role = Role(guild=self, data=data, state=self._state)

        return role

    async def edit_role_positions(self, positions: Mapping[Snowflake, int], *, reason: Optional[str] = None) -> List[Role]:
        """|coro|

        Bulk edits a list of :class:`Role` in the guild.

Review comment (suggestion):
```suggestion
        colours = {
            'primary_color': fields['color'],
        }
        
        if actual_secondary_colour is not MISSING:
            if actual_secondary_colour is None:
                colours['secondary_color'] = None
            elif isinstance(actual_secondary_colour, int):
                colours['secondary_color'] = actual_secondary_colour
            else:
                colours['secondary_color'] = actual_secondary_colour.value
        if actual_tertiary_colour is not MISSING:
            if actual_tertiary_colour is None:
                colours['tertiary_color'] = None
            elif isinstance(actual_tertiary_colour, int):
                colours['tertiary_color'] = actual_tertiary_colour
            else:
                colours['tertiary_color'] = actual_tertiary_colour.value

        fields['colors'] = colours
```

Code after:
        fields['colors'] = colours

        if hoist is not MISSING:
            fields['hoist'] = hoist

        if display_icon is not MISSING:
            if isinstance(display_icon, bytes):
                fields['icon'] = utils._bytes_to_base64_data(display_icon)
            else:
                fields['unicode_emoji'] = display_icon

        if mentionable is not MISSING:
            fields['mentionable'] = mentionable

        if name is not MISSING:
            fields['name'] = name

        data = await self._state.http.create_role(self.id, reason=reason, **fields)
        role = Role(guild=self, data=data, state=self._state)

        return role

    async def edit_role_positions(self, positions: Mapping[Snowflake, int], *, reason: Optional[str] = None) -> List[Role]:
        """|coro|

        Bulk edits a list of :class:`Role` in the guild.

        You must have :attr:`~Permissions.manage_roles` to do this.

        .. versionadded:: 1.4

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` instead of
            ``InvalidArgument``.

        Example
        ----------

        .. code-block:: python3

            positions = {
                bots_role: 1, # penultimate role
                tester_role: 2,
                admin_role: 6
            }

            await guild.edit_role_positions(positions=positions)

        Parameters
        -----------
        positions