Commit Graph

71 Commits

Author SHA1 Message Date
6d57ddf11b Correct Member.__hash__
Make Member.__hash__ just use whatever its User object's hash impl is.
2018-08-23 19:10:29 -06:00
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
d58fc0ccee [lint] Remove unused imports
Left over from various refactoring and rewrites.
2018-08-22 21:43:50 -04:00
f25091efe1 Drop support for Python 3.4 and make minimum version 3.5.2. 2018-06-10 18:10:00 -04:00
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
3112e1c17e Add intersphinx 2018-01-06 17:23:59 -05:00
21fd94a449 Attempt to change how member functions are detected for Member objects 2017-09-04 20:03:50 -04:00
62df23633a Sort roles by hierarchy instead of by ID.
Fixes #741
2017-08-29 16:24:04 -04:00
7ee63a26f0 Fix docstring 2017-08-22 04:45:52 -04:00
84f38b166e Add atomic keyword argument for member role editing operations.
This affects:

* Member.add_roles
* Member.remove_roles

This is the main attempt of fixing long standing bugs like #56. Since
cache consistency is too hard to ask for due to eventual consistency
and this generally being one of the only main roadblocks that the
cache ruins, it's best to just implement it in terms of the atomic
endpoint instead.

Fixes #56
2017-08-21 10:40:33 -04:00
be1cffb7c3 Support for discord.Object in Member.remove_roles and Member.add_roles 2017-08-09 18:41:54 -04:00
723e392c95 Properly sort roles and discard everyone role in Member.colour. 2017-06-24 20:55:47 -04:00
f588876587 Use Python3Lexer instead of PythonLexer for pygments. 2017-05-22 07:21:23 -04:00
229c471106 More broken Channel references. 2017-05-20 08:48:04 -04:00
f4e01b3a92 Make supported operations stand out more than attributes. 2017-05-20 02:08:34 -04:00
8526995004 Minor speedup when doing comparisons.
Shred 2 getattr calls + 1 global lookup to 1 global lookup.
2017-05-18 05:15:06 -04:00
8e34a256a4 Fix User == Member comparisons. 2017-05-18 05:12:48 -04:00
f73eb087c9 Use describe instead of tables for supported operations. 2017-05-13 18:48:14 -04:00
b44bba6ee6 First pass at documentation reform. 2017-05-12 20:14:34 -04:00
5106feaf57 Allow comparison between User and Member instances again. 2017-05-10 19:32:25 -04:00
dff6bcc745 Add support for audit log reasons.
Most routes now have a 'reason' keyword argument.
2017-05-07 03:08:06 -04:00
d24c2a09b6 Change some format usage to use %-formatting.
Minor speed increase when we're not doing excessive attribute
access or any type of formatting.
2017-05-04 06:04:55 -04:00
c54a6a927d Implement audit logs. 2017-04-30 02:58:27 -04:00
1fc08bc5a2 Remove unused imports. 2017-04-18 04:22:35 -04:00
ead18e3948 Fix issue with members not copying correctly. 2017-03-05 07:48:15 -05:00
67912193ec Forward keyword arguments in Member.ban 2017-02-21 08:38:33 -05:00
bfe2b4fc03 Fix Member.display_name to work. 2017-02-10 03:10:30 -05:00
a632bdd871 Fix Member.permissions_in passing in the wrong self parameter. 2017-01-31 04:53:54 -05:00
e77012f4d9 Make all public is_ functions into methods instead of properties. 2017-01-29 20:53:17 -05:00
554ae196d3 Add missing int casts in many different events in the state.
Also remove redundant role parsing in Member._update_roles.
2017-01-28 08:14:43 -05:00
ff9f5749e1 Update copyright year to 2017. 2017-01-20 23:19:19 -05:00
4c981ee631 Add support for relationships. 2017-01-20 19:28:43 -05:00
fa384f2114 Make ClientUser separate from a regular User.
This removes Client.edit_profile in favour of ClientUser.edit.
2017-01-19 19:37:11 -05:00
92dd519b1a Remove _get_guild_id from Messageable ABC. 2017-01-14 19:22:26 -05:00
aae8b783e9 VoiceChannel.voice_members is now computed when needed. 2017-01-08 04:31:33 -05:00
c863d93f69 Fix bug that made member roles go missing. 2017-01-03 20:17:58 -05:00
7690455b21 Make User and Member messageable. 2017-01-03 09:52:12 -05:00
98b981848d Move message creation to a factory method inside ConnectionState. 2017-01-03 09:52:10 -05:00
dceba9d962 Add useful repr to all data classes. 2017-01-03 09:52:06 -05:00
79a49f9145 Absolute import some circular dependencies to appease Python 3.4. 2017-01-03 09:52:02 -05:00
59a0df5f98 Rename try_insert_user to store_user 2017-01-03 09:51:56 -05:00
5cb3ad14e8 Make emojis and members stateful. 2017-01-03 09:51:55 -05:00
d1d54a468a Rename Server to Guild everywhere. 2017-01-03 09:51:54 -05:00
31229a53e9 Optimise VoiceState for memory.
Instead of storing one VoiceState per Member, only store them if
necessary. This should bring down the number of instances
significantly.
2017-01-03 09:51:47 -05:00
044b0824e6 Begin working on the rewrite. 2017-01-03 09:51:47 -05:00
14def4b68e Fix Member.server_permissions docstring. 2016-10-04 18:55:34 -04:00
625ed18cff Add Member.server_permissions to calculate server permissions. 2016-09-21 04:50:22 -04:00
13f85b3292 Make Roles totally ordered.
This also fixes a bug with Member.top_role that chose the wrong role
should they have the same position.
2016-09-21 04:22:12 -04:00
b0e5357716 Fix voice state update issue in on_voice_state_update
Bug was caused to the shallow copy not copying over the VoiceState
information embedded into the copy. This would mean that when the event
is called, before and after voice state information is essentially
equivalent.

The solution to fix this is to also copy the VoiceState objects.
2016-07-23 05:18:56 -04:00
b13029b993 Remove unused internal code in Member. 2016-07-22 18:09:53 -04:00