60 Commits

Author SHA1 Message Date
Rapptz
d3249445f3 Revert "Allow empty strings to be in Embed.to_dict"
This reverts commit a72fc7416c8f17ee270a0f13ae160a60b9127630.

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
Stocker
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
NCPlayz
fb02191b80 Organise documentation 2019-03-19 08:24:42 -04:00
Rapptz
4bd4c23694 Fix NameError in Embed.to_dict 2019-03-17 11:51:54 -04:00
Michael H
03616b91db Fix embed to_dict timestamp handling for python 3.5
resolves #1992
2019-03-17 09:17:14 -04:00
Rapptz
70c5f1723f Fix Embed.to_dict to work with TZ aware datetime objects. 2019-03-15 05:56:01 -04:00
Rapptz
7fbdc6e83f Add Embed.copy to do a copy on an embed object. 2019-03-13 06:08:21 -04:00
Rapptz
35a330c5d3 Add Embed.__len__ to query total character size of an embed. 2019-03-13 06:07:57 -04:00
Rapptz
73aca4d4d3 Expose Embed.from_data as Embed.from_dict
This is a breaking change.
2019-03-13 06:02:56 -04:00
Dante Dam
9656a21ebe Bumped copyright years to 2019. 2019-01-28 22:22:50 -05:00
Hornwitser
c8b49d37be [lint] Fix incorrect and inconsistent whitespace
Adjust whitespace to be consistent with the rest of the library.
2018-08-22 21:43:53 -04:00
Tobotimus
3112e1c17e Add intersphinx 2018-01-06 17:23:59 -05:00