2002 Commits

Author SHA1 Message Date
SnowyLuma
2b4cf5dafc Set premium_since when copying and updating Member 2019-06-11 21:13:43 +02:00
Rapptz
e00635fba7 Version bump to 1.2.2 v1.2.2 2019-06-09 21:51:43 -04:00
Toby Harradine
e3e2e38511
Update docs to note Enum derivation change 2019-06-10 00:53:10 +10:00
Rapptz
3730e66d37 Crowdin translation sync 2019-06-09 08:20:43 -04:00
Rapptz
855a6c5b59 Fix descriptor detection in enum code. 2019-06-09 08:13:29 -04:00
Rapptz
7980213745 Version bump to 1.2.1 v1.2.1 2019-06-09 02:18:43 -04:00
Rapptz
2b761508f1 Disallow deleting of enum attributes. 2019-06-09 02:13:40 -04:00
Rapptz
6931189b92 Add EnumMeta.__reversed__ just in case someone does this.
I sure hope not.
2019-06-09 02:02:06 -04:00
Rapptz
a92b4c2093 Add EnumMeta.__len__ to not break user avatar code. 2019-06-09 01:59:23 -04:00
Rapptz
af4e3ad79b Some documentation touch-ups and missing stuff in the changelog. 2019-06-09 01:24:41 -04:00
Rapptz
d7814cfb25 Remove unused import. 2019-06-09 01:06:20 -04:00
Rapptz
a8f0a03247 Version bump to 1.2.0 v1.2.0 2019-06-09 00:39:38 -04:00
Rapptz
655aa39603 Fix reference typo in SystemChannelFlags 2019-06-09 00:38:46 -04:00
Rapptz
7e2da1c93b Publicly expose a type property for all channels.
Fix #2185
2019-06-09 00:23:22 -04:00
Rapptz
991140eebe Replace Enum with an internal one for significant speed improvements.
This has been a massive pain point for me personally due to the poor
design of the Enum class leading to the common use cases used in the
library being significantly slow. Since this Enum is not public facing
in terms of *creation*, I can only implement the APIs that are used
when *accessing* them.

This Enum is a drop-in replacement to the pre-existing enum.Enum class
except it comes with significant speed-ups. Since this is a lot to go
over, I will let the numbers speak for themselves:

In [4]: %timeit enums.try_enum(enums.Status, 'offline')
263 ns ± 34.3 ns per loop (7 runs, 1000000 loops each)
In [5]: %timeit NeoStatus.try_value('offline')
134 ns ± 0.859 ns per loop (7 runs, 10000000 loops each)

In [6]: %timeit enums.Status.offline
116 ns ± 0.378 ns per loop (7 runs, 10000000 loops each)
In [7]: %timeit NeoStatus.offline
31.6 ns ± 0.327 ns per loop (7 runs, 10000000 loops each)

In [8]: %timeit enums.Status.offline.value
382 ns ± 15.2 ns per loop (7 runs, 1000000 loops each)
In [9]: %timeit NeoStatus.offline.value
65.5 ns ± 0.953 ns per loop (7 runs, 10000000 loops each)

In [10]: %timeit str(enums.Status.offline)
630 ns ± 14.8 ns per loop (7 runs, 1000000 loops each)
In [11]: %timeit str(NeoStatus.offline)
253 ns ± 3.53 ns per loop (7 runs, 1000000 loops each)

In [12]: %timeit enums.Status('offline')
697 ns ± 8.42 ns per loop (7 runs, 1000000 loops each)
In [13]: %timeit NeoStatus('offline')
182 ns ± 1.83 ns per loop (7 runs, 10000000 loops each)
2019-06-09 00:06:34 -04:00
Rapptz
8bf0482af5 Fix exception hierarchy documentation. 2019-06-08 21:23:42 -04:00
NCPlayz
126f4f8271 Implement Guild.get_all_premium_subscribers 2019-06-08 21:19:10 +01:00
Rapptz
c97b097f07 Document new Guild.features 2019-06-07 22:26:05 -04:00
Rapptz
f84219c2b2 Improve performance of parsing MESSAGE_UPDATE and MESSAGE_CREATE events
Embed edits are no longer special cased in the dispatch code, which
could lead to on_message_edit being called more often than it used to
be called. I am not sure on the general impact on that being removed.

Fixes #2195
2019-06-07 22:18:01 -04:00
NCPlayz
3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
NCPlayz
2f05436653 Added comment for/redo system information 2019-06-07 19:23:44 -04:00
NCPlayz
f7c6c5995d Implementing GET '/channels/:id' & '/guilds/:id/channels'
Signed-off-by: NCPlayz <chowdhurynadir0@outlook.com>
2019-06-07 19:12:59 -04:00
Rapptz
320dbc0618 Add support for system channel flags 2019-06-06 22:30:02 -04:00
Rapptz
fcf02414fe Fix stray colon in Asset related docstrings 2019-06-04 19:06:31 -04:00
Rapptz
9674055c2a Add support for animated guild icons. 2019-06-04 19:04:44 -04:00
Rapptz
5dce3410e6 Add support for new message types related to premium guilds. 2019-06-04 18:30:47 -04:00
Rapptz
2b27a7a9d5 Add Member.premium_since to denote member boost date. 2019-06-04 18:30:46 -04:00
Rapptz
8e80eee0d1 Add Emoji.available field 2019-06-04 18:30:46 -04:00
Rapptz
a048815c60 Add Guild.premium_subscription_count 2019-06-04 18:30:46 -04:00
Rapptz
e40c68b75a Add Guild.premium_tier and corresponding limits. 2019-06-04 18:30:46 -04:00
Rapptz
90ae3f396c Probably fix indentation. 2019-05-30 19:39:50 -04:00
Rapptz
bfb1edcc05 Update readthedocs.yml to v2 configuration file. 2019-05-30 19:33:14 -04:00
Rapptz
483aa5465d Properly handle compute_prune_count in prune members endpoint. 2019-05-30 18:01:03 -04:00
Rapptz
00a0856cc4 Use a dict instead of getattr for parsing events.
Probably not a significant difference but might as well use it here.
The basic idea is to cache the getattr calls instead of repeatedly
doing it (since they're around 105ns on my machine). The dictionary
lookup is about 41ns on my machine.

The next step in speeding up library code some more should be in
the parser bodies themselves but that's a problem to tackle another
day.
2019-05-29 01:22:53 -04:00
Rapptz
0622e18cb9 Speed-up utils.get for the common cases 2019-05-29 00:45:48 -04:00
Rapptz
0d72ac3bb6 Ensure message links resolve in the Messageable.pins note. 2019-05-27 04:05:51 -04:00
Rapptz
96dc6f0c11 Add note that Messageable.pins does not contain Message.reactions
Fix for #2189
2019-05-27 04:04:06 -04:00
Rapptz
2cd6d771ec Make __repr__ slightly more detailed and add a few missing ones.
This includes raw events (which didn't have any) and a few other
types that were missing them. Upon review some more useful fields were
added to the repr output which would be more useful during debugging.
2019-05-26 02:32:47 -04:00
Rapptz
ab6dd2a27a Add note for Message.tts
Fix #2186
2019-05-25 06:17:52 -04:00
Rapptz
3c387e9031 Use attrgetter to speed up Member attribute access by 2x. 2019-05-25 03:14:35 -04:00
Rapptz
d96b8a0b80 Add Discord error code to HTTPException message. 2019-05-24 04:23:06 -04:00
Ehren Julien-Neitzert
fc5a2936dd Fix pluralization errors in various files
* Replaced instances of 'return an' with 'returns an'
* fixed pluralization errors
2019-05-23 23:31:17 -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
Harmon
2fd589874f Fix wording in documentation for ClientUser.locale 2019-05-21 21:15:26 -04:00
Dante Dam
998980ed9a Added example for template checkboxes 2019-05-21 21:15:25 -04:00
Dante Dam
92731bbf5f [commands] Fixed extra "only" in dm_only docs 2019-05-19 20:04:42 -07:00
Rapptz
964b97aa30 Add table showing what methods get invite attributes. 2019-05-19 19:17:30 -04:00
Rapptz
82b54933e2 Add asyncio.Task subclass for better __repr__ for events. 2019-05-19 19:17:29 -04:00
Suhail
db9a293f14 [tasks] Add version added note to Loop.change_interval 2019-05-19 19:17:28 -04:00