143 Commits

Author SHA1 Message Date
Rapptz
88d825a803 Allow use of orjson instead of json
The difference in speed seems negligible at start up, which is when
most time is taken for actually parsing JSON. I could potentially be
missing something but profiling didn't point to any discernable
difference.
2021-07-07 20:19:17 -04:00
Rapptz
4152819a3c Ignore linting error when accessing Python 3.10 unions 2021-07-04 05:55:29 -04:00
Rapptz
2ce44f7bd6 Add versionadded for format_dt 2021-06-28 03:36:16 -04:00
Rapptz
d1a2ee4620 Add discord.utils.format_dt helper function 2021-06-28 01:31:14 -04:00
Soheab
dbb135b81a
Add disable_guild_select to utils.oauth_url() 2021-06-27 23:37:02 -04:00
Rapptz
fc66c5b92d Fix some webhook related type checker errors 2021-06-10 07:57:41 -04:00
Rapptz
aeb2cfb573 Add private get_slots utility to get slots through MRO 2021-05-28 01:56:48 -04:00
Rapptz
3c90f16bf0 Fix cached_slot_property typings again 2021-05-23 21:30:44 -04:00
Sebastian Law
8bc489dba8
[tasks] Add support for explicit time parameter 2021-05-09 23:27:43 -04:00
Rapptz
de965c2bf5 Simplify SnowflakeList type hints 2021-05-06 08:23:18 -04:00
Josh
3864fb37a0
Fix various reference issues in documentation
Co-Authored-By: Riley Shaw <30989490+ShineyDev@users.noreply.github.com>
2021-05-06 07:51:07 -04:00
Rapptz
7bad27d215 Fix SnowflakeList typings 2021-05-05 23:33:11 -04:00
Rapptz
cd7357b93a Add classproperty helper utility
This is apparently a 3.9+ only addition
2021-05-02 08:05:52 -04:00
Rapptz
4c97b8efdd Fix typings for utils._parse_ratelimit_header
A CIMultiDict is not a Dict but a Mapping
2021-05-01 09:24:47 -04:00
Rapptz
7b8db49efe Fix utils.MISSING not evaluating to True in implicit bool contexts 2021-04-30 01:05:01 -04:00
Nadir Chowdhury
c786a85a9b
Add utils.MISSING 2021-04-29 01:58:36 -04:00
Olivia
a2df6e81b8
[commands] Update error message for Literal float/complex 2021-04-27 22:04:18 -04:00
Rapptz
9f3551926a Split annotation resolution to discord.utils 2021-04-27 05:48:27 -04:00
Josh
3c2674725a
Add as_chunks helper function 2021-04-25 23:36:03 -04:00
Josh
e5607822d3
Define utils.cached_property in if TYPE_CHECKING guard 2021-04-22 21:11:56 -04:00
Rapptz
ac7588f735 Fix some typings in utils 2021-04-20 04:35:53 -04:00
Rapptz
3c8d3ab078 Add a third overload to parse_time
Apparently this behaviour is intended in Pyright
https://github.com/microsoft/pyright/issues/1772

Despite mypy behaving as intended.
2021-04-19 02:12:41 -04:00
Rapptz
bee6402d84 Fix utils.find predicate typing to accept Any 2021-04-19 02:11:38 -04:00
Rapptz
417353da4d Fix up _unique and valid_icon_size implementations 2021-04-18 09:07:26 -04:00
Rapptz
b35596f7c8 Add typings for discord.utils 2021-04-18 08:43:09 -04:00
Rapptz
cc4dced7c0 Cleanup some of the prior typings for cached_slot_property 2021-04-18 08:07:11 -04:00
Nadir Chowdhury
18badbc60f
Add typing for utils.cached(_slot)_property 2021-04-18 07:56:38 -04:00
Maya
0f3f2cbeea
Fix spelling error in utils.__all__ 2021-04-11 20:18:56 -04:00
Nadir Chowdhury
3e92196a2b
Add typings for audit logs, integrations, and webhooks 2021-04-10 02:53:24 -04:00
Nadir Chowdhury
89456022cf
Add __all__ to remaining modules 2021-04-07 02:30:32 -04:00
Rapptz
7e3c5f3faf Fix some regressions from create_task change 2021-04-06 07:31:31 -04:00
Nadir Chowdhury
2ff24a27b5
Use asyncio.create_task over asyncio.ensure_future 2021-04-05 20:31:03 -04:00
Rapptz
a3a6f88936 Add discord.utils.utcnow() helper function to ease migration 2021-04-04 23:59:04 -04:00
Rapptz
93a92e6e1b Remove special casing of MAX_ASYNCIO_SECONDS in sleep_until
This compatibility code goes away in Python versions greater than 3.7
2021-04-04 23:55:15 -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
Sebastian Law
d6501159e7
[docs] copy signature from overridden and inherited methods 2021-03-29 23:52:14 -04:00
Edwin
31ee3fafc1
Add remove_markdown helper function 2021-03-28 18:38:34 -04:00
Nihaal Sangha
a4d29e8cfd
Add scopes to utils.oauth_url 2021-03-28 06:33:24 -04:00
Nihaal Sangha
a3f700c11f
Fix references to snowflakes being max 21 long 2021-03-02 19:04:03 -05:00
Nadir Chowdhury
63ec23bac2
Code optimisations and refactoring via Sourcery 2021-02-24 21:26:51 -05:00
Rapptz
abfc07f968 Fix up previous PR mistake with intentional backslashes 2021-02-21 07:35:31 -05:00
Sebastian Law
a0c1d6f6c5
Fix backslashes showing up in the docs 2021-02-21 07:32:11 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present 2021-01-15 05:28:11 -05:00
Nadir Chowdhury
6b803acde4
[chore] Remove redundant imports
This also removes the historical patch for NullHandler implemented in bbf1c54, as it has been available since Python 3.1.
2020-11-28 03:16:49 -05:00
Rapptz
d9acc2f491 Escape multi-line quotes properly
Fix #5897
2020-10-17 01:36:31 -04:00
ChristopherJHart
f308f34db1
Add note pointing to discord.AllowedMentions 2020-10-04 22:52:00 -04:00
Nadir Chowdhury
6d88316767
Fix NameError with resolving codes with Template 2020-07-31 21:07:20 -04:00
Rapptz
4de01212a4 Fix detection of some JPEG images without JFIF or Exif info
Closes #5143
2020-07-21 22:56:51 -04:00
NCPlayz
3408695a37 [docs] fix reference to Guild and document utils.resolve_template 2020-07-08 23:01:00 -04:00