Repository: Rapptz/discord.py

Issue:
Embed.Empty functionality does not work as expected.
### Summary

According to the documentation for `set_thumbnail` and `set_image`:

> Changed in version 1.4: Passing Empty removes the thumbnail.

This does not function as expected. `set_author` and `set_footer` do not share the same problem.

### Reproduction Steps

```
embed = discord.Embed(...)
embed.set_thumbnail(url=Embed.Empty)
embed.set_image(url=Embed.Empty)
```

### Expected Results

The thumbnail and image both appear unset.

### Actual Results

```
_ClientEventTask exception was never retrieved
future: <ClientEventTask state=finished event=on_command_error coro=<bound method Bot.on_command_error of <s4.bot.bot.Bot object at 0x000001E116E814F0>> exception=AttributeError('_thumbnail')>
Traceback (most recent call last):
  File "D:\Programs\Python\Discord Bots\Bots\S4\.venv\lib\site-packages\discord\client.py", line 317, in _run_event
    await self.on_error(event_name, *args, **kwargs)
  File "D:\Programs\Python\Discord Bots\Bots\S4\s4\bot\bot.py", line 103, in on_error
    await error.error(err, *args, **kwargs)
  File "D:\Programs\Python\Discord Bots\Bots\S4\.venv\lib\site-packages\discord\client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "D:\Programs\Python\Discord Bots\Bots\S4\s4\bot\bot.py", line 107, in on_command_error
    await error.command_error(ctx, exc)
  File "D:\Programs\Python\Discord Bots\Bots\S4\s4\bot\cogs\error.py", line 124, in command_error
    raise original
  File "D:\Programs\Python\Discord Bots\Bots\S4\.venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "D:\Programs\Python\Discord Bots\Bots\S4\s4\bot\cogs\meta.py", line 160, in botinfo_command
    embed=self.bot.embed.build(
  File "D:\Programs\Python\Discord Bots\Bots\S4\s4\utils\embed.py", line 35, in build
    embed.set_thumbnail(url=Embed.Empty)
  File "D:\Programs\Python\Discord Bots\Bots\S4\.venv\lib\site-packages\discord\embeds.py", line 328, in set_thumbnail
    del self._thumbnail
AttributeError: _thumbnail
```

### Checklist

- [x] I have searched the open issues for duplicates.
- [x] I have shown the entire traceback, if possible.
- [x] I have removed my token from display, if visible.

### System Information

- Python v3.8.5-final
- discord.py v1.4.0-final
- aiohttp v3.6.2
- system info: Windows 10 10.0.19041



Discussion:
As I understand it:
That note says "remove"; it's used to remove a thumbnail that is already there, not for denoting that there is no thumbnail. If you don't want one, don't call set_thumbnail.
That does make sense, but I feel like `embed.remove_thumbnail()` would make that a clearer intended case. The code reads as though you are setting the thumbnail to an empty value, rather than removing an existing thumbnail. Same for images.
Considering `remove_author` and `remove_field` catch the `AttributeError` that is raised in the same logic, I feel this is a fair thing to change IMO. 

Resolving patch:
diff --git a/discord/embeds.py b/discord/embeds.py
--- a/discord/embeds.py
+++ b/discord/embeds.py
@@ -286,7 +286,10 @@ def set_image(self, *, url):
         """
 
         if url is EmptyEmbed:
-            del self._image
+            try:
+                del self._image
+            except AttributeError:
+                pass
         else:
             self._image = {
                 'url': str(url)
@@ -325,7 +328,10 @@ def set_thumbnail(self, *, url):
         """
 
         if url is EmptyEmbed:
-            del self._thumbnail
+            try:
+                del self._thumbnail
+            except AttributeError:
+                pass
         else:
             self._thumbnail = {
                 'url': str(url)


Test patch: