diff options
| author | Rapptz <[email protected]> | 2019-03-13 06:08:21 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-03-13 06:08:21 -0400 |
| commit | 7fbdc6e83fccc7c3eb9c40087801e99d5a38211f (patch) | |
| tree | e0f46950e60de0cca28bfa312703b62a0a129e1b /discord/embeds.py | |
| parent | Add Embed.__len__ to query total character size of an embed. (diff) | |
| download | discord.py-7fbdc6e83fccc7c3eb9c40087801e99d5a38211f.tar.xz discord.py-7fbdc6e83fccc7c3eb9c40087801e99d5a38211f.zip | |
Add Embed.copy to do a copy on an embed object.
Diffstat (limited to 'discord/embeds.py')
| -rw-r--r-- | discord/embeds.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/embeds.py b/discord/embeds.py index 663e9ea0..b756d55f 100644 --- a/discord/embeds.py +++ b/discord/embeds.py @@ -169,6 +169,10 @@ class Embed: return self + def copy(self): + """Returns a shallow copy of the embed.""" + return Embed.from_dict(self.to_dict()) + def __len__(self): total = len(self.title) + len(self.description) for field in getattr(self, '_fields', []): |