64 Commits

Author SHA1 Message Date
apple502j
6d0db182b9 Add new alias VerificationLevel.very_high 2020-04-09 17:10:44 +09:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
Rapptz
a841efa087 Add support for custom activities
It's been long enough.

Fixes #2400
2020-01-14 20:37:48 -05:00
NCPlayz
787d424dce Add VoiceRegion.dubai 2020-01-06 00:30:04 -05:00
Christian Clauss
f9b8b234e3
Typo: AuditLogActionCategory 2019-12-23 00:49:17 +01:00
Rapptz
c92ca4ee07 Add Profile.system and Profile.team_user to query newer flags 2019-12-21 07:46:15 -05:00
NCPlayz
f554819506 Implement Webhook.type 2019-11-26 05:16:53 -05:00
Josh B
7df5effbb7 Add new audit log entry types. Fix issue with unknown entry types 2019-11-26 05:16:53 -05:00
apple502j
6241983a99 Add europe region 2019-10-17 05:56:01 -04:00
Dice
da4bb0610c Add CHANNEL_FOLLOW_ADD Message Type
Add documentation for MessageType.channel_follow_add

Add versionchanged to new MessageType attr

Add system_content for new MessageType
2019-08-27 04:05:03 -04:00
fourjr
3961e7ef6d Support team members data in application info 2019-06-29 19:14:24 -04:00
Rapptz
1e982e0042 Cast activity enumerator to integer instead of accessing value directly
Should make the library more resilient to future changes.
2019-06-25 21:50:06 -04:00
Rapptz
855a6c5b59 Fix descriptor detection in enum code. 2019-06-09 08:13:29 -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
d7814cfb25 Remove unused import. 2019-06-09 01:06:20 -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
5dce3410e6 Add support for new message types related to premium guilds. 2019-06-04 18:30:47 -04:00
apple502j
357abf2e55 Add India region to VoiceRegion 2019-05-13 20:26:10 -04:00
Rapptz
919dbcafb3 Consistent use of __all__ to prevent merge conflicts. 2019-04-20 17:20:58 -04:00
Rapptz
6f26a4aad8 Improve performance of value -> enum by about 5x. 2019-04-15 21:30:47 -04:00
Rapptz
67ec59caea Fix issue with speaking state causing an error. 2019-04-08 23:08:43 -04:00
Rapptz
0ddc6867e9 Change all IntEnum to Enum
A testament to how many 3.5 users there are.
2019-04-08 17:51:14 -04:00
CapnS
4ec7213506 Added functionality to edit user settings
Changing docs to fit other parts of the lib

Co-Authored-By: CapnS <38225872+CapnS@users.noreply.github.com>

Removing Type Checking

Made all of Rapptz's suggested changes

Removing imports that are no longer needed
2019-03-28 17:33:39 -04:00
Rapptz
5061915b2a Add support for store channels. 2019-03-17 14:32:51 -04:00
Rapptz
5ea84fb971 Add support for guild news channels. 2019-03-08 21:40:43 -05:00
Liam H
79f172cf80 Add PremiumType enumeration and ClientUser.premium_type 2019-02-12 19:01:10 -05:00
Imayhaveborkedit
9c5259afd7 Update voice code to vws V4
- Update internals to be compatible with v4
- Adds multiple encryption mode support.  Previously only `xsalsa20_poly1305` was supported.  Now `xsalsa20_poly1305_suffix` is also supported.
  Note: There is no (nice) way to manually select a mode.  The user needn't worry about this however.
- Fixed speaking state bug.  When you disconnected from a voice channel while a bot was playing, upon reconnect you would be unable to hear the bot.  This was caused by bots not sending their speaking state while transmitting.  Bots will now set their speaking state properly when transmitting.  
  Note: This does not account for sending actual silence, the speaking indicator will still be active.
2019-01-28 22:22:52 -05:00
Dante Dam
9656a21ebe Bumped copyright years to 2019. 2019-01-28 22:22:50 -05:00
Rapptz
8b18fa307b Add support for default notification level in audit logs and Guild.edit 2018-11-25 01:42:33 -05:00
Chris
1ac432d9f0 Add Guild.default_notifications 2018-11-24 23:05:26 -05:00
bmintz
c184b0a53d add support for Bug Hunter and Early Supporter flags 2018-11-24 22:34:22 -05:00
mental
ee57e89488 Added hypesquad house functionality 2018-08-22 22:01:19 -04:00
MaximusPX
4a1d28a1de Adds missing voice regions. 2018-08-22 21:07:54 -04:00
Rapptz
f8f8f418f3 Split Game object to separate Activity subtypes for Rich Presences.
This is a massive breaking change.

* All references to "game" have been renamed to "activity"
* Activity objects contain a majority of the rich presence information
* Game and Streaming are subtypes for memory optimisation purposes for
  the more common cases.
* Introduce a more specialised read-only type, Spotify, for the
  official Spotify integration to make it easier to use.
2018-03-05 11:15:49 -05:00
Mippy (William)
98c8928934 Missing Voice Regions 2017-11-12 16:58:31 -05:00
Rapptz
53b4890435 Add category support.
This adds:

* CategoryChannel, which represents a category
* Guild.by_category() which traverses the channels grouping by category
* Guild.categories to get a list of categories
* abc.GuildChannel.category to get the category a channel belongs to
* sync_permissions keyword argument to abc.GuildChannel.edit to sync
  permissions with a pre-existing or new category
* category keyword argument to abc.GuildChannel.edit to move a channel
  to a category
2017-09-13 09:44:36 -04:00
Gorialis
934456035e Change VerificationLevel, ContentFilter to be IntEnums 2017-08-02 01:24:05 +09:00
Rapptz
25a1d8c300 Add support for user flags in Profile. 2017-06-30 18:49:49 -04:00
Rapptz
83f86f902a Rename verification level to extreme due to demand. 2017-05-27 22:19:31 -04:00
Rapptz
ee3c77353f Add highest verification level. 2017-05-27 01:12:06 -04:00
Rapptz
a0fc1402d7 Rename GuildRegion to VoiceRegion.
This naming makes more sense since voice regions are not a guild
exclusive concept.
2017-05-09 13:42:35 -04:00
Rapptz
86bfcdd129 Add support for message delete audit log action type. 2017-05-04 04:35:02 -04:00
Rapptz
c54a6a927d Implement audit logs. 2017-04-30 02:58:27 -04:00
Rapptz
83649d7f0a Support for new member message types. 2017-04-21 03:49:05 -04:00
Rapptz
0e5bf09021 Export missing enums. 2017-04-12 20:20:35 -04:00
Rapptz
728fae9285 Add Guild.explicit_content_filter. 2017-04-12 20:18:28 -04:00
Rapptz
ff9f5749e1 Update copyright year to 2017. 2017-01-20 23:19:19 -05:00
Rapptz
4c981ee631 Add support for relationships. 2017-01-20 19:28:43 -05:00