Commit Graph
70 Commits
Author SHA1 Message Date
Rapptz 44a44e938f Reformat entire project with ruff instead of black 2025-08-18 20:16:10 -04:00
Roberto Scifo 667e7c9065 Fixed to_dict() bug for user-defined embed classes 2025-06-20 14:55:44 -04:00
Alex Nørgaard e177b4a705 Fix EmbedMediaProxy boolean check 2025-06-20 14:30:10 -04:00
dolfies 8594dd1b30 Fix embed media flags regression 2025-03-04 18:24:38 -05:00
dolfies cab4732b7e Make embed flags required and add them to all media fields 2025-03-04 02:07:51 -05:00
DA344andDanny 8a95c0190c Add support for embed flags and update attachment flags
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2025-02-12 05:42:17 -05:00
MajorTanya a8134dfa16 Fix Embed type attribute ddocs link 2025-02-08 21:00:49 -05:00
Rapptz 3018fee443 Remove stale documentation in Embed.set_thumbnail 2024-08-28 15:51:17 -04:00
lmaotrigine 8104ff2ad4 [docs] Fix typehint for Embed.set_(image,thumbnail) 2024-08-28 15:50:51 -04:00
fretgfr 794f2bf149 [docs] correct hyperlink to discord docs 2024-08-28 15:48:38 -04:00
Rapptz d3249445f3 Revert "Allow empty strings to be in Embed.to_dict"
This reverts commit a72fc7416c.

Discord no longer allows this and the original rationale for allowing
this was weak to begin with.
2023-01-10 15:58:37 -05:00
Soheab_ a72fc7416c Allow empty strings to be in Embed.to_dict 2022-12-14 19:11:12 -05:00
Rapptz bc00bc495e Document attachment:// URI more prominently in Embed docs 2022-08-18 09:50:16 -04:00
Vioshim b80cb47caf Implement Embed.__eq__ and EmbedProxy.__eq__ 2022-07-27 00:28:10 -04:00
Rapptz cf031f71b9 Add a new extlink for discord documentation 2022-05-27 04:05:01 -04:00
Jonah Lawrence 1451074d66 Return embed from clear_fields and remove_field 2022-05-04 23:53:50 -04:00
Vioshim 4ce60b4cac Documented Embed limits in docstrings 2022-04-08 21:53:08 -04:00
jack1142 5ffa3e85de Update comments after # type: ignore to be compatible with PEP 484 2022-03-27 22:26:34 -04:00
Rapptz c6ab67420e Remove Embed.Empty in favour of None 2022-03-14 00:52:55 -04:00
5aa696ccfa Fix typing issues and improve typing completeness across the library
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-03-13 23:52:10 -04:00
Josh 147948af9b Use typing.Self throughout library 2022-03-01 07:53:24 -05:00
Josh a315786869 Handle type-errors in upcoming pyright release 2022-02-22 08:51:11 -05:00
Rapptz d01e73fca5 Document more uses of type ignore 2022-02-21 23:08:26 -05:00
Rapptz 88b520b5ab Reformat code using black
Segments where readability was hampered were fixed by appropriate
format skipping directives. New code should hopefully be black
compatible. The moment they remove the -S option is probably the moment
I stop using black though.
2022-02-20 08:04:58 -05:00
Rapptz 565b41b0b2 Fix Embed.from_dict typing being too strict for a public function
The Embed TypedDict is not publicly accessible so would always lead
to type errors upon usage.
2021-08-24 03:15:06 -04:00
thegamecracks 6ce1c537d4 Localize Embed.timestamp during assignment 2021-06-28 00:00:17 -04:00
Arnav Jindal dd727fb6f4 Add Embed.remove_footer 2021-06-07 03:33:11 -04:00
Mikey f42e922696 Fix bug in Embed.__len__ caused by footer without text 2021-05-27 00:45:35 -04:00
Nadir Chowdhury 8f9819eb4c [docs] Fix various unresolved references 2021-04-15 22:41:41 -04:00
Rapptz 9da2f349e7 Use Any instead of str for Embed typings for accuracy 2021-04-08 20:12:08 -04:00
Sebastian Law 4c72137e43 [docs] add note for possible Embed.type strings 2021-04-07 07:17:57 -04:00
Rapptz f49d565d51 Rename discord.types file based on relevant core module file 2021-04-07 05:50:54 -04:00
Rapptz 23fe6b46dd Typehint discord.Embed and introduce discord.types subpackage
The discord.types subpackage is currently only used to do type hinting
of API payloads, it's very much incomplete right now and it'll be a
rather long process.

discord.Embed was typehinted and formatted using black.
2021-04-07 05:39:58 -04:00
Nadir Chowdhury 89456022cf Add __all__ to remaining modules 2021-04-07 02:30:32 -04:00
Rapptz ed1341012b Add Embed.__bool__
Fixes #6661
2021-04-07 00:01:57 -04:00
Rapptz ff7094ce96 Convert datetimes to aware datetimes with UTC.
Naive datetimes will now be interpreted as local time throughout
the library.
2021-04-04 23:54:08 -04:00
Rapptz 9d39b135f4 Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by
default. It also changes some methods to use `yield from`.
2021-04-04 07:03:53 -04:00
pikaninja 5a93e80e87 Implicitly cast Embed construction parameters to str 2021-03-24 23:13:57 -04:00
Nihaal Sangha 69bdc3a184 Change copyright year to present 2021-01-15 05:28:11 -05:00
Dan Hess e04bd1b3a1 Fix error when trying to clear empty image/thumbnail in embeds 2020-08-07 01:07:54 -04:00
Sebastian Law b4b953bfc6 Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
jack1142 a601cf43ab Allow clearing the author information in embeds. 2020-05-23 21:47:25 -04:00
Rapptz 66c6be50d8 Prepare for the discord.com domain rename 2020-05-23 21:44:30 -04:00
Riley Shaw 75d3c4f6cf allow passing EmptyEmbed to set_image and set_thumbnail 2020-05-02 19:57:48 -04:00
Rapptz 02397306b2 Drop superfluous zero in version related changes in the documentation 2020-01-21 03:47:56 -05:00
Rapptz 6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
NCPlayz 3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
Dante Dam 84e9168447 Grammar fixes for notes on EmbedProxy 2019-05-23 23:21:40 -04:00
Kyber f2c7b2e6d8 Add an insert_field_at method for the embed class 2019-05-23 23:21:39 -04:00
Rapptz 792b31833a Mention what can be done during initialisation in embeds. 2019-05-07 00:24:25 -04:00