Commit Graph

632 Commits

Author SHA1 Message Date
6061f83c3f Fix bug with edit_profile for user accounts 2016-06-23 13:52:42 -05:00
c02d9403e6 Fix bug with Client.server_voice_state not deafening. 2016-06-22 19:39:20 -04:00
8b3617111a Support for v5 Gateway. 2016-06-22 05:00:08 -04:00
c3c9db7777 Fix bug with deleting private messages.
This was due to an AttributeError occurring when getting the guild_id
from the channel. PrivateChannels do not have guild_ids so they should
be None.
2016-06-20 22:11:43 -04:00
6b4d22ce81 Clarify that Client.logs_from can take a PrivateChannel too. 2016-06-18 02:15:36 -04:00
b3edb31df5 Add support for message pinning.
This includes `Client.pin_message`, `Client.unpin_message` and
`Client.pins_from`. This also adds the `Message.pinned` attribute
to the `Message` object.
2016-06-18 02:14:44 -04:00
2ebc0ab218 Don't assume that any shared fields are optional in Client.edit_channel.
Thanks Jake and night.
2016-06-15 20:56:43 -04:00
eeba4963f3 The name is required in Client.edit_channel so add it if it is missing. 2016-06-15 20:31:13 -04:00
7c760d3271 Add Client.get_message 2016-06-15 04:46:19 -04:00
d7efc9778b Make Client.edit_channel_permissions use PermissionOverwrite. 2016-06-14 22:26:14 -04:00
f0fc70b2cf Add a way to set permission overwrites when creating a channel. 2016-06-14 22:26:14 -04:00
46babe822a Fix bug with editing messages over private messages. 2016-06-14 22:26:13 -04:00
7d5d8aa918 Doc string typos 2016-06-14 18:53:40 -04:00
f6ef4868d1 Fix concurrently joining more than one voice server at a time 2016-06-13 01:43:55 -07:00
8d1867393c Give Client.email a default value of None. 2016-06-12 23:44:41 -04:00
c3933c379a Make the default filename a little bit prettier. 2016-06-12 23:43:03 -04:00
3895cf9295 Fix bug with login token not being properly written in cache. 2016-06-12 23:25:22 -04:00
b496ea7972 Fix bug with logs_from URL params not being correct.
The bug happened because I forgot to pass in the id attribute.
2016-06-12 23:00:33 -04:00
f3b257b342 Fix bug with uploading file-like objects.
I would require bytes-like objects instead due to its usage inside
the HTTPClient. Release this restriction so old `send_file` code works.
2016-06-12 22:41:30 -04:00
64c1e7d199 Fix bug with logging in with email and password. 2016-06-12 22:41:14 -04:00
879584b81a Fix bug with edit_role and create_role not working.
This was due to an error in overzealous removal of code.
2016-06-12 22:40:35 -04:00
1fba1b06fa Rewrite HTTP handling significantly.
This should have a more uniform approach to rate limit handling. Instead
of queueing every request, wait until we receive a 429 and then block
the requesting bucket until we're done being rate limited. This should
reduce the number of 429s done by the API significantly (about 66% avg).

This also consistently checks for 502 retries across all requests.
2016-06-12 20:33:09 -04:00
fa36a449e9 Change HTTPException to only take a single parameter. 2016-06-12 13:57:05 -04:00
a175c86aa1 Add Client.application_info to retrieve the current app info.
Fixes #241.
2016-06-10 22:28:15 -04:00
631cc5a7d6 Add Client.move_channel to change channel positions. 2016-06-07 21:29:59 -04:00
329f916e10 Add bot keyword argument to login via static token. 2016-06-03 02:12:39 -04:00
5016f12079 Add Role.server attribute.
This breaks events that expected a server parameter for the role events.
2016-06-01 19:27:48 -04:00
e0a91df32b Add RESUME support. 2016-06-01 05:13:15 -04:00
c8698787fa Allow datetime in limit parameters for purge_from
Check for datetime instead of using logs_from, for 3.4 compatibility
2016-05-31 19:35:14 -04:00
70cc5eb1bb Allow to edit mentionable property in Client.edit_role. 2016-05-27 14:03:50 -04:00
aa45bce212 Documentation fixes for role related functions. 2016-05-23 15:03:22 -04:00
8f4816ddae Close voice connections before closing the websocket. 2016-05-22 00:58:27 -04:00
c2e7a68105 Fix purge_from to use LogsFromIterator.create (#219) 2016-05-20 21:15:43 -04:00
fe1b5b2941 Add support for voice channel user limits. 2016-05-20 18:11:58 -04:00
492c9afffb logs_from improvements for after param.
- Properly support 'after' alone
- Properly support both 'before' and 'after'
- Add optional 'reverse' parameter to sort messages oldest->newest to
  1) provide a sorted result set for 'after'
  2) give flexibility when using both 'before' and 'after'
2016-05-20 18:11:57 -04:00
8e5347f4ed Allow datetime in limit parameters for logs_from.
Add time_snowflake to convert a datetime to a "snowflake".
2016-05-20 18:11:56 -04:00
7bdddc37a0 Retry send_file on 502.
Rename _rate_limit_helper to _retry_helper
2016-05-20 18:11:56 -04:00
a1b5cefc8b Add move_role
move_role will only send changed roles.
discord will accept trying to move to position 0, or trying to move the
everyone role. It will result in unexpected changes, so we prohibit it.
2016-05-20 18:11:55 -04:00
92175ea152 Add example for Client.purge_from 2016-05-12 09:05:51 -04:00
132873d159 Add clarification for purge_from and delete_messages
Endpoint not usable by non-bot accounts
2016-05-11 17:13:34 +02:00
b8eab5f656 Change second run_until_complete to not be empty.
This should stop the infinite loops in some cases.
2016-05-10 20:21:08 -04:00
0c8d5ee863 Force encoding of text retrieval functions to use utf-8.
Closes #207
2016-05-10 19:52:34 -04:00
1e175f2ab3 Fix issue with Client.purge_from not deleting the 101st message. 2016-05-10 19:39:58 -04:00
1f86a9b795 Add Client.purge_from as a high level interface around bulk delete. 2016-05-10 08:43:09 -04:00
1b601097d2 Add Client.delete_messages for bulk delete. 2016-05-10 07:52:22 -04:00
701720a0f8 Add a TimeoutError if VoiceClient.connect fails. 2016-05-06 13:30:44 -04:00
d9c780b8a8 Working multi-server voice support. 2016-05-01 20:54:13 -04:00
7bae6dc5bc Fix changing own nickname without manage_nicknames
Use @me/nick rather than id when changing own nickname - this only
requires change_nicknames rather than manage.
2016-04-30 20:34:02 -04:00
07adb1d5e9 Add ability to change nicknames via Client.change_nickname 2016-04-29 07:18:01 -04:00
c1b5a52823 Refactor voice websocket into gateway.py 2016-04-27 18:36:24 -04:00