# Buggy code
async def userinfo(self, ctx, *, user: discord.Member = None):
    """Show information about a user.

    This includes fields for status, discord join date, server
    join date, voice state and previous names/nicknames.

    If the user has no roles, previous names or previous nicknames,
    these fields will be omitted.
    """
    author = ctx.author
    guild = ctx.guild

    if not user:
        user = author

    #  A special case for a special someone :^)
    special_date = datetime(2016, 1, 10, 6, 8, 4, 443000)
    is_special = user.id == 96130341705637888 and guild.id == 133049272517001216

    roles = user.roles[-1:0:-1]
    names, nicks = await self.get_names_and_nicks(user)

    joined_at = user.joined_at if not is_special else special_date
    since_created = (ctx.message.created_at - user.created_at).days
    if joined_at is not None:
        since_joined = (ctx.message.created_at - joined_at).days
        user_joined = joined_at.strftime("%d %b %Y %H:%M")
    else:
        since_joined = "?"
        user_joined = _("Unknown")
    user_created = user.created_at.strftime("%d %b %Y %H:%M")
    voice_state = user.voice
    member_number = (
        sorted(
            guild.members, key=lambda m: m.joined_at or ctx.message.created_at
        ).index(user)
        + 1
    )

    created_on = _("{}\n({} days ago)").format(user_created, since_created)
    joined_on = _("{}\n({} days ago)").format(user_joined, since_joined)

    activity = _("Chilling in {} status").format(user.status)
    if user.activity is None:  # Default status
        pass
    elif user.activity.type == discord.ActivityType.playing:
        activity = _("Playing {}").format(user.activity.name)
    elif user.activity.type == discord.ActivityType.streaming:
        activity = _("Streaming [{}]({})").format(user.activity.name, user.activity.url)
    elif user.activity.type == discord.ActivityType.listening:
        activity = _("Listening to {}").format(user.activity.name)
    elif user.activity.type == discord.ActivityType.watching:
        activity = _("Watching {}").format(user.activity.name)

    if roles:
        roles = ", ".join([x.mention for x in roles])
    else:
        roles = None

    data = discord.Embed(description=activity, colour=user.colour)
    data.add_field(name=_("Joined Discord on"), value=created_on)
    data.add_field(name=_("Joined this server on"), value=joined_on)
    if roles is not None:
        data.add_field(name=_("Roles"), value=roles, inline=False)
    if names:
        # May need sanitizing later, but mentions do not ping in embeds currently
        val = filter_invites(", ".join(names))
        data.add_field(name=_("Previous Names"), value=val, inline=False)
    if nicks:
        # May need sanitizing later, but mentions do not ping in embeds currently
        val = filter_invites(", ".join(nicks))
        data.add_field(name=_("Previous Nicknames"), value=val, inline=False)
    if voice_state and voice_state.channel:
        data.add_field(
            name=_("Current voice channel"),
            value="{0.mention} ID: {0.id}".format(voice_state.channel),
            inline=False,
        )
    data.set_footer(text=_("Member #{} | User ID: {}").format(member_number, user.id))

    name = str(user)
    name = " ~ ".join((name, user.nick)) if user.nick else name
    name = filter_invites(name)

    if user.avatar:
        avatar = user.avatar_url_as(static_format="png")
        data.set_author(name=name, url=avatar)
        data.set_thumbnail(url=avatar)
    else:
        data.set_author(name=name)

    await ctx.send(embed=data)


# Traceback (discord.ext.commands.errors.CommandInvokeError)
Exception in command 'userinfo'
Traceback (most recent call last):
File "/home/redbot/.pyenv/versions/redbot/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped
ret = await coro(*args, **kwargs)
File "/home/redbot/.pyenv/versions/redbot/lib/python3.7/site-packages/redbot/cogs/mod/names.py", line 164, in userinfo
await ctx.send(embed=data)
File "/home/redbot/.pyenv/versions/redbot/lib/python3.7/site-packages/redbot/core/commands/context.py", line 64, in send
return await super().send(content=content, **kwargs)
File "/home/redbot/.pyenv/versions/redbot/lib/python3.7/site-packages/discord/abc.py", line 823, in send
data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, nonce=nonce)
File "/home/redbot/.pyenv/versions/redbot/lib/python3.7/site-packages/discord/http.py", line 222, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 BAD REQUEST (error code: 50035): Invalid Form Body
In embed.fields.2.value: Must be 1024 or fewer in length.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/redbot/.pyenv/versions/redbot/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 863, in invoke
await ctx.command.invoke(ctx)
File "/home/redbot/.pyenv/versions/redbot/lib/python3.7/site-packages/discord/ext/commands/core.py", line 728, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/redbot/.pyenv/versions/redbot/lib/python3.7/site-packages/discord/ext/commands/core.py", line 88, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 BAD REQUEST (error code: 50035): Invalid Form Body
In embed.fields.2.value: Must be 1024 or fewer in length.

# Fixed code
async def userinfo(self, ctx, *, user: discord.Member = None):
    """Show information about a user.

    This includes fields for status, discord join date, server
    join date, voice state and previous names/nicknames.

    If the user has no roles, previous names or previous nicknames,
    these fields will be omitted.
    """
    author = ctx.author
    guild = ctx.guild

    if not user:
        user = author

    #  A special case for a special someone :^)
    special_date = datetime(2016, 1, 10, 6, 8, 4, 443000)
    is_special = user.id == 96130341705637888 and guild.id == 133049272517001216

    roles = user.roles[-1:0:-1]
    names, nicks = await self.get_names_and_nicks(user)

    joined_at = user.joined_at if not is_special else special_date
    since_created = (ctx.message.created_at - user.created_at).days
    if joined_at is not None:
        since_joined = (ctx.message.created_at - joined_at).days
        user_joined = joined_at.strftime("%d %b %Y %H:%M")
    else:
        since_joined = "?"
        user_joined = _("Unknown")
    user_created = user.created_at.strftime("%d %b %Y %H:%M")
    voice_state = user.voice
    member_number = (
        sorted(
            guild.members, key=lambda m: m.joined_at or ctx.message.created_at
        ).index(user)
        + 1
    )

    created_on = _("{}\n({} days ago)").format(user_created, since_created)
    joined_on = _("{}\n({} days ago)").format(user_joined, since_joined)

    activity = _("Chilling in {} status").format(user.status)
    if user.activity is None:  # Default status
        pass
    elif user.activity.type == discord.ActivityType.playing:
        activity = _("Playing {}").format(user.activity.name)
    elif user.activity.type == discord.ActivityType.streaming:
        activity = _("Streaming [{}]({})").format(user.activity.name, user.activity.url)
    elif user.activity.type == discord.ActivityType.listening:
        activity = _("Listening to {}").format(user.activity.name)
    elif user.activity.type == discord.ActivityType.watching:
        activity = _("Watching {}").format(user.activity.name)

    if roles:
        role_str = ", ".join([x.mention for x in roles])
        # 400 BAD REQUEST (error code: 50035): Invalid Form Body
        # In embed.fields.2.value: Must be 1024 or fewer in length.
        if len(role_str) > 1024:
            # Alternative string building time.
            # This is not the most optimal, but if you're hitting this, you are losing more time
            # to every single check running on users than the occasional user info invoke
            # We don't start by building this way, since the number of times we hit this should be
            # infintesimally small compared to when we don't across all uses of Red.
            continuation_string = _(
                "and {numeric_number} more roles not displayed due to embed limits."
            )
            available_length = 1024 - len(
                continuation_string
            )  # do not attempt to tweak, i18n

            role_chunks = []
            remaining_roles = 0

            for r in roles:
                chunk = f"{r.mention}, "
                chunk_size = len(chunk)

                if chunk_size < available_length:
                    available_length -= chunk_size
                    role_chunks.append(chunk)
                else:
                    remaining_roles += 1

            role_chunks.append(
                continuation_string.format(numeric_number=remaining_roles)
            )

            role_str = "".join(role_chunks)

    else:
        role_str = None

    data = discord.Embed(description=activity, colour=user.colour)
    data.add_field(name=_("Joined Discord on"), value=created_on)
    data.add_field(name=_("Joined this server on"), value=joined_on)
    if role_str is not None:
        data.add_field(name=_("Roles"), value=role_str, inline=False)
    if names:
        # May need sanitizing later, but mentions do not ping in embeds currently
        val = filter_invites(", ".join(names))
        data.add_field(name=_("Previous Names"), value=val, inline=False)
    if nicks:
        # May need sanitizing later, but mentions do not ping in embeds currently
        val = filter_invites(", ".join(nicks))
        data.add_field(name=_("Previous Nicknames"), value=val, inline=False)
    if voice_state and voice_state.channel:
        data.add_field(
            name=_("Current voice channel"),
            value="{0.mention} ID: {0.id}".format(voice_state.channel),
            inline=False,
        )
    data.set_footer(text=_("Member #{} | User ID: {}").format(member_number, user.id))

    name = str(user)
    name = " ~ ".join((name, user.nick)) if user.nick else name
    name = filter_invites(name)

    if user.avatar:
        avatar = user.avatar_url_as(static_format="png")
        data.set_author(name=name, url=avatar)
        data.set_thumbnail(url=avatar)
    else:
        data.set_author(name=name)

    await ctx.send(embed=data)