815 Commits

Author SHA1 Message Date
Rapptz
a76909e182 Fix RESUME handling and make sure to wait 5 seconds before attempting. 2017-04-22 21:36:29 -04:00
khazhyk
6dca5035df Add timeouts for websocket initial connections.
In DiscordWebSocket and DiscordVoiceWebsocket the from_client factory
methods can hang indefintely on all websocket ops. We set static
timeouts and attempt to reconnect if we time out.

Additionally, do not return from DiscordVoiceWebSocket.from_client
until we set up the keep alive thread, which is created after we
receive the READY payload.
2017-04-22 01:50:36 -04:00
Rapptz
516c3ce530 Use an asyncio.Event instead of an asyncio.Lock for global rate limits.
There were some dead-locking issues that I suspect were due to the
way the global rate limit was handled. This changes it into a simple
Event that allows multiple coroutines to pass through instead of one
by one.
2017-04-08 18:06:11 -04:00
Rapptz
75e4163169 Don't reconnect in sharding related codes. 2017-03-15 16:54:39 -04:00
cookkkie
2f159098b1 Better timeout handling in join_voice_channel 2017-03-13 02:25:10 +01:00
cookkkie
38ea40f403 Add rollback strategy to Client.join_voice_channel 2017-03-13 01:24:27 +01:00
Rapptz
440bd0da60 Version bump to v0.16.7 2017-02-27 18:10:27 -05:00
Rapptz
7257ed24d8 Remove nonce when sending messages. 2017-02-27 18:02:38 -05:00
Rapptz
23ba3253dd Version bump to v0.16.6 2017-02-14 23:26:04 -05:00
Rapptz
9341be6be8 Handle HEARTBEAT_ACK 2017-02-14 23:18:02 -05:00
Rapptz
dae3c66a54 Ensure after is called inside the daemon thread for players. 2017-02-14 00:57:30 -05:00
Rapptz
e2de93e2a6 [commands] Make Command a descriptor for #426. 2017-02-11 05:52:27 -05:00
Rapptz
ae30d2a880 Removed unused variables in routes. 2017-02-09 02:45:44 -05:00
Rapptz
e6c5e40ab0 Remove unused constants in HTTPClient 2017-02-08 20:46:38 -05:00
Rapptz
91fcce30e6 Add missing continue statement in gateway futures. 2017-02-08 20:30:34 -05:00
Rapptz
3558a0db27 Only defer the lock if we're pre-emptively rate limiting.
If a 429 was already hit somehow then we're no longer pre-emptively
rate limiting and we're going to end up having a race condition in
the lock/unlock cycle.
2017-02-08 03:47:53 -05:00
Rapptz
2a6c240271 [commands] Better support for retrieving children commands.
* GroupMixin.get_command now supports fully qualified names
* Add GroupMixin.walk_commands to get an iterator of all commands.
2017-02-06 21:08:29 -05:00
Rapptz
f06024f236 Fix potential chunking woe. 2017-01-23 07:08:29 -05:00
khazhyk
d409196d3d Fix Client.create_server.
Client was using .name of enum instead of .value, resulting in
invalid requests being sent to discord.
edit_server region changing was not broken as the region field
was str()'d, which uses .value.

Also document that most bot accounts cannot use create_server.
2017-01-22 13:01:06 -08:00
Rapptz
ea95d723e8 Version bump to v0.16.5 2017-01-21 16:20:17 -05:00
Rapptz
e9a09539be Allow unique invites to be created in Client.create_invite. 2017-01-21 16:19:53 -05:00
Rapptz
de18a0ee47 Fix issue with chunking on userbots when a guild is unavailable. 2017-01-21 16:14:45 -05:00
Rapptz
5a6a3574b1 Fix bug with Client.move_channel and Client.move_role. 2017-01-16 18:13:49 -05:00
Rapptz
793cbedd0d Fix case where on_reaction_add returned None in PMs with users. 2017-01-13 01:11:32 -05:00
Rapptz
9626210633 Fix 404s with Client.pins_from and Client.create_role. 2017-01-12 17:59:41 -05:00
Rapptz
89eb3392af Fix HTTPClient errors from the backport. 2017-01-09 21:00:24 -05:00
Rapptz
d460a747f6 Version bump to v0.16.1 2017-01-09 19:51:33 -05:00
Rapptz
6cd134ee47 Allow falsey values in Client.send_message and Client.send_file. 2017-01-09 19:51:32 -05:00
Rapptz
f0fb91c35d Use CDN URL for assets. 2017-01-09 19:36:48 -05:00
Rapptz
fdd835e8f1 Backport rate limit header implementation from rewrite. 2017-01-09 19:33:39 -05:00
Kyle Repinski
643950abf8 Add ability to set opus encoder input signal type. 2017-01-03 09:51:14 -05:00
PapyrusThePlant
31cd9ad37a [commands] Bugfix on the teardown function call. 2017-01-01 01:49:10 -05:00
Rapptz
a8264f6540 Chunk every guild if it's a user bot.
This also increases the timeout for chunking by 30 seconds for every
chunk we're waiting for.
2016-12-24 17:32:20 -05:00
Rapptz
4d59bca4aa Support animated avatars in User.avatar_url. 2016-12-23 00:43:19 -05:00
Rapptz
bed2e90e82 Properly propagate loop. Fixes #420. 2016-12-21 00:06:19 -05:00
Rapptz
5731f3405d Version bump to v0.16.0. 2016-12-19 17:53:41 -05:00
Rapptz
00e30f3106 [commands] Shield against dictionary resize in Bot.close 2016-12-17 21:18:48 -05:00
Rapptz
fc1a7183a0 [commands] Unload all cogs when gracefully exiting bot. 2016-12-17 14:47:29 -05:00
Rapptz
b8909ae389 [commands] Properly propagate CommandError derived exceptions.
If a command or a group raised a CommandError derived exception it
would be wrapped into CommandInvokeError. This fixes this case so it
raises the original exception instead.
2016-12-17 14:44:36 -05:00
Rapptz
6d88024f0f [commands] Add special extension function 'teardown' for clean-up.
This is to support people who want to clean up some external resource
that the extension is maintaining outside of a cog, where __unload
should be used instead.

The callable is the antipode of 'setup' and takes the same sole
parameter, the bot, after all commands, events, and cogs have been
unloaded.

Fixes #405.
2016-12-17 14:15:11 -05:00
Rapptz
bafaf72c89 [commands] Unload all extensions when gracefully closing bot. 2016-12-17 14:15:10 -05:00
Rapptz
c7946606f4 Add Channel.overwrites to get a channel's permission overwrites.
Fixes #414.
2016-12-17 14:00:34 -05:00
Rapptz
6302ef8094 Add support for partnered servers. Fixes #387.
This commit allows you to edit a server's invite splash, query if
something has partnered features, and retrieve the invite splash + URL.
2016-12-17 13:34:19 -05:00
Rapptz
a0f4ad36eb Timeout waiting for chunking.
Sometimes the bot would keep waiting for chunks that somehow finished
before getting to the `wait` call. This is more so a temporary fix
rather than a fully correct one.
2016-12-16 21:28:12 -05:00
Rapptz
6306fc08db Discard null sequences in the gateway.
This was forbidding the Discord gateway from allowing us to RESUME
properly, causing an over-abundance of READY being called.
2016-12-16 18:29:29 -05:00
khazhyk
b1117262da [commands] Run global checks in help formatter.
Help formatter was not checking global bot-level checks, resulting in
showing commands a user did not have permission for with
show_check_failure disabled.
2016-12-16 14:39:25 -05:00
Rapptz
51fda76555 Fix typo in wait_for_reaction documentation. 2016-12-07 07:23:12 -05:00
Rapptz
b7c90a5e3d Fix role comparisons.
Fixes #409
2016-12-02 01:28:54 -05:00
Rapptz
64733c0b19 Version bump to v0.15.1 2016-11-30 17:05:29 -05:00
khazhyk
c8fd8a9e1a Fix crash on duplicate or out of order reactions.
Eventual consistency ftw
2016-11-30 16:47:00 -05:00