question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embed Scheme is 'none'

See original GitHub issue

Summary

Sending embeds is broken for new discord version (1.6 -> 1.7.1)

Reproduction Steps

My bot used to work before with version 1.6. After upgrading to 1.7.1, all embeds fail to send with the same stack trace.

Minimal Reproducible Code

No response

Expected Results

The embed should be sent correctly. Screenshot of the expected result image

Actual Results

Fails with the following stacktrace

ERROR:asyncio:_ClientEventTask exception was never retrieved
future: <ClientEventTask state=finished event=on_command_error coro=<function on_command_error at 0x7fadc1af0c10> exception=HTTPException('400 Bad Request (error code: 50035): Invalid Form Body\nIn embed.url: Scheme "none" is not supported. Scheme must be one of (\'http\', \'https\').')>
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "bot.py", line 337, in on_command_error
    await ctx.guild.get_channel(ADMIN_CHANNEL_ID).send(embed=embed)
  File "/app/.heroku/python/lib/python3.8/site-packages/discord/abc.py", line 1064, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
  File "/app/.heroku/python/lib/python3.8/site-packages/discord/http.py", line 254, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.url: Scheme "none" is not supported. Scheme must be one of ('http', 'https').

Intents

members

System Information

What works:

~ $ python -m discord -v
- Python v3.8.5-final
- discord.py v1.6.0-final
- aiohttp v3.7.4.post0
- system info: Linux 4.4.0-1086-aws #90-Ubuntu SMP Wed Feb 17 07:04:43 UTC 2021

What doesn’t work:

~ $ python -m discord -v
- Python v3.8.5-final
- discord.py v1.7.1-final
- aiohttp v3.7.4.post0
- system info: Linux 4.4.0-1086-aws #90-Ubuntu SMP Wed Feb 17 07:04:43 UTC 2021

Checklist

I have searched the open issues for duplicates. I have shown the entire traceback, if possible. I have removed my token from display, if visible.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Rapptzcommented, Apr 6, 2021

These methods were not documented to accept None and were documented to be implicitly casted to str. There was a bug originally that didn’t do it at init time and I guess this caused an unfortunate bug to surface on your end.

I don’t really consider it breaking since the documentation never mentioned it was okay to pass None.

0reactions
sergreecommented, Apr 30, 2021

Faced the same problem.

My old code:

def __construct_embed(title, description, url=None):
    embed = discord.Embed(
            title=title,
            color=config.embed_color,
            description=description,
            url=url
        )
    return embed

Solution:

def __construct_embed(title, description, url=discord.embeds.EmptyEmbed):
    embed = discord.Embed(
            title=title,
            color=config.embed_color,
            description=description,
            url=url
        )
    return embed

The code worked perfectly for a few years, don’t tell me it’s not a library problem. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DiscordAPIError: Invalid Form Body embed.image.url: Scheme ...
You must provide an image url so instead of your current fetch where you try to get the image you have to provide...
Read more >
Scheme has no Embedded Points - Math Stack Exchange
It's been a while since this question has been asked, nevertheless, let me try to give an answer: Indeed, a reduced scheme has...
Read more >
Looking for embeddable scheme - Reddit
I've been looking for a Scheme distribution for embedding into a C++ ... so no fighting against the library to get it to...
Read more >
Embedding - The CHICKEN Scheme wiki
Calling this function more than once has no effect. ... If threads have been spawned during earlier invocations of embedded Scheme code, then...
Read more >
9 Embedding into a Program (BC) - Racket Documentation
To embed Racket CGC in a program, follow these steps: ... When an embedding application calls scheme_main_setup with a non-zero first argument, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found