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

Code before:
                    else:
                        duration = f"{minutes} minutes"
                elif seconds < (threshold_h * hours_s):
                    hours = round(seconds / hours_s)
                    if hours == 1:
                        duration = "an hour"
                    else:
                        duration = f"{hours} hours"
                elif seconds < (threshold_d * days_s):
                    days = round(seconds / days_s)
                    if days == 1:
                        duration = "a day"
                    else:
                        duration = f"{days} days"
                elif seconds < (threshold_M * months_s):
                    months = round(seconds / months_s)
                    if months == 1:
                        duration = "a month"
                    else:
                        duration = f"{months} months"
                else:
                    years = round(seconds / years_s)
                    if years == 1:
                        duration = "a year"
                    else:
                        duration = f"{years} years"

                if missed:
                    return 'You missed a call from {0.author.name} that lasted {1}.'.format(self, duration)
                else:
                    return '{0.author.name} started a call that lasted {1}.'.format(self, duration)
            else:
                if missed:
                    return '{0.author.name} started a call. \N{EM DASH} Join the call'.format(self)
                else:
                    return '{0.author.name} started a call.'.format(self)

        # Fallback for unknown message types
        return ''

    @overload
    async def edit(
        self,
        *,
        content: Optional[str] = ...,
        embed: Optional[Embed] = ...,
        attachments: Sequence[Union[Attachment, File]] = ...,
        suppress: bool = ...,
        delete_after: Optional[float] = ...,
        allowed_mentions: Optional[AllowedMentions] = ...,
        view: Optional[View] = ...,

Review comment (suggestion):
I forgot to mention this on Discord (sorry) but this should have been a util function instead of bloating up the size of this one.

Code after:
    async def edit(
        self,
        *,
        content: Optional[str] = ...,
        embed: Optional[Embed] = ...,
        attachments: Sequence[Union[Attachment, File]] = ...,
        suppress: bool = ...,
        delete_after: Optional[float] = ...,
        allowed_mentions: Optional[AllowedMentions] = ...,
        view: Optional[View] = ...,
    ) -> Message:
        ...

    @overload
    async def edit(
        self,
        *,
        content: Optional[str] = ...,
        embeds: Sequence[Embed] = ...,
        attachments: Sequence[Union[Attachment, File]] = ...,
        suppress: bool = ...,
        delete_after: Optional[float] = ...,
        allowed_mentions: Optional[AllowedMentions] = ...,
        view: Optional[View] = ...,
    ) -> Message:
        ...

    async def edit(
        self,
        *,
        content: Optional[str] = MISSING,
        embed: Optional[Embed] = MISSING,
        embeds: Sequence[Embed] = MISSING,
        attachments: Sequence[Union[Attachment, File]] = MISSING,
        suppress: bool = False,
        delete_after: Optional[float] = None,
        allowed_mentions: Optional[AllowedMentions] = MISSING,
        view: Optional[View] = MISSING,
    ) -> Message:
        """|coro|

        Edits the message.

        The content must be able to be transformed into a string via ``str(content)``.

        .. versionchanged:: 1.3
            The ``suppress`` keyword-only parameter was added.

        .. versionchanged:: 2.0
            Edits are no longer in-place, the newly edited message is returned instead.