aboutsummaryrefslogtreecommitdiff
path: root/discord/state.py
Commit message (Collapse)AuthorAgeFilesLines
* Add heartbeat_timeout to the Client options.Rapptz2017-08-081-1/+1
| | | | | | | This setting configures how long before a timeout event is emitted internally and disconnects the websocket. Since some users were experiencing issues with the gateway not responding, this should help mitigate the issue for those with poor PCs.
* Accidentally left a print statement.Rapptz2017-07-051-1/+0
|
* Implement a LRU cache for private channels.Rapptz2017-07-041-4/+20
| | | | | | Another fix related to the discord issue[1]. [1]: https://github.com/hammerandchisel/discord-api-docs/issues/184
* Don't unnecessarily re-create private channels.Rapptz2017-07-041-3/+6
| | | | | | | | New API change[1] will make it so CHANNEL_CREATE will keep getting sent for private channels, so might as well avoid the overhead of constantly creating the channel if we can avoid it. [1]: https://github.com/hammerandchisel/discord-api-docs/issues/184
* Downgrade PartialReactionEmoji to str in non-raw reaction events.Rapptz2017-06-091-1/+4
|
* Defer logging formatting until the logger is actually called.Rapptz2017-06-091-1/+1
| | | | | This would cause unnecessary format calls even if you didn't have logging enabled.
* Implement "partial" message events.Rapptz2017-06-091-13/+52
| | | | | These are events that get triggered regardless of the state of the message cache. Useful for getting data from before the bot was booted.
* Don't expose Client.messagesRapptz2017-05-261-7/+7
| | | | | | | Not entirely sure why it was exposed in the first place. Most uses with it essentially boiled down to mis-usage when they meant to use the /messages endpoint (via Client.logs_from or Messageable.history) or complaining about the partial data woes that came from it.
* Don't dispatch on_voice_state_update when Member is not found.Rapptz2017-05-221-1/+3
|
* Allow setting a presence upon logging in.Rapptz2017-05-201-1/+16
|
* Split on_channel_pins_update as well.Rapptz2017-05-051-2/+16
|
* Rework some events to make more sense.Rapptz2017-05-051-9/+10
| | | | | | | | | | | | | | This is a breaking change. 1. Change on_guild_emojis_update to have 3 arguments. - The first parameter is now the guild object 2. Remove on_channel_create, on_channel_delete, and on_channel_update - They are now split into two. - on_guild_channel_[create|delete|update] - on_private_channel_[create|delete|update] 3. Change on_member_ban to allow User. - (member) -> (guild, user) - user can also be a Member
* Make sure that the chunker task only runs once.Rapptz2017-05-011-25/+34
|
* Add Client.get_emoji to get an Emoji from an ID.Rapptz2017-04-301-0/+3
|
* Don't set VoiceClient.channel to None when VOICE_STATE_UPDATE says so.Rapptz2017-04-261-1/+3
| | | | | | Sometimes VOICE_STATE_UPDATE gives us a channel_id: null payload and we would end up clearing the VoiceClient.channel state along with it.
* Fix some linting errors.Rapptz2017-04-221-4/+1
|
* Better handling of VOICE_SERVER_UPDATE.Rapptz2017-04-181-2/+2
| | | | | | This now sort of respects "Awaiting Endpoint..." waiting. I haven't actually tested out this case since it's hard to get it. However this new code does work with the regular connection flow.
* Re-implement voice sending.Rapptz2017-04-181-0/+10
| | | | | | | | | | | | | | | | | | | | This is a complete redesign of the old voice code. A list of major changes is as follows: * The voice websocket will now automatically reconnect with exponential back-off just like the regular Client does. * Removal of the stream player concept. * Audio now gracefully pauses and resumes when a disconnect is found. * Introduce a discord.AudioSource concept to abstract streams * Flatten previous stream player functionality with the VoiceClient, e.g. player.stop() is now voice_client.stop() * With the above re-coupling this means you no longer have to store players anywhere. * The after function now requires a single parameter, the error, if any existed. This will typically be None. A lot of this design is experimental.
* Don't clear state when READY is reached for auto sharded clients.Rapptz2017-04-161-1/+0
|
* Improve logging in more places.Rapptz2017-04-121-2/+3
| | | | | | This shows the Shard ID in more places, along with a gateway trace and session ID. Also helps show the RESUME/IDENTIFY/RESUMED/READY flow a bit more instead of it looking like the connection has zombied out.
* Use global user cache to fetch reaction event data.Rapptz2017-04-091-9/+6
| | | | | Also make sure it isn't dispatched unless the data meets the integrity checks (i.e. not None).
* Fix KeyError in certain logging cases.Rapptz2017-04-071-2/+2
|
* Keep track of Emoji instances myself.Rapptz2017-03-291-2/+8
| | | | | | WeakValueDictionary cleans up too late and brings too little benefit. Also clean up the state when the first READY is encountered for AutoShardedClient and when any READY is encountered in regular Client.
* Always overwrite Emoji references in the state.Rapptz2017-03-261-5/+2
| | | | | | | | | There is potential that when recreating the Emoji list in the GUILD_EMOJIS_UPDATE event would just fetch from cache and the element in cache having an out of date Guild reference. This Guild reference will be kept alive for longer than it should be. By always overwriting the Emoji reference, this problem goes away.
* Fix memory leak by holding on to Emoji references weakly.Rapptz2017-03-241-1/+1
| | | | | | | The library had a memory leak in the case using the global emoji cache. When the bot would leave the guild, the Emoji would maintain a strong reference to the Guild keeping them alive along with the entire state associated with it.
* Revert "Reference the ConnectionState by weakref."Rapptz2017-03-241-19/+19
| | | | This reverts commit 730a0e2d5375a5c49bcc2a146f0cde1e7dc85f24.
* Reference the ConnectionState by weakref instead of a strong reference.Rapptz2017-03-221-19/+19
| | | | | | Hopefully this means when the bot has some lingering object for whatever reason, the memory doesn't double due to it having a strong reference to an outdated connection state.
* Eventual consistency fixes.Rapptz2017-03-211-3/+41
|
* Remove call handling for now.Rapptz2017-03-131-19/+0
|
* Fix issue with members not copying correctly.Rapptz2017-03-051-1/+1
|
* Remove remaining voice_member tracking.Rapptz2017-02-281-11/+0
|
* Check for PrivateChannel before GuildChannel in Client.get_channelRapptz2017-02-251-4/+4
|
* Wrap asyncio.wait into a saner alternative that raises TimeoutError.Rapptz2017-02-251-3/+3
| | | | Fixes #494
* Fix Client.emojis returning a list of IDs.Rapptz2017-02-211-1/+1
|
* Add Client.emojis to get all emojis.Rapptz2017-02-101-0/+4
| | | | This removes the older get_all_emojis generator.
* Add missing int casts in many different events in the state.Rapptz2017-01-281-9/+13
| | | | Also remove redundant role parsing in Member._update_roles.
* Add compatibility shim for asyncio.Future creation.Rapptz2017-01-251-1/+1
| | | | Should provide better support for uvloop.
* Add option to disable auto member chunking.Rapptz2017-01-231-36/+53
|
* Fix issue with user bots chunking unavailable guilds.Rapptz2017-01-211-2/+2
|
* Update copyright year to 2017.Rapptz2017-01-201-1/+1
|
* Add support for relationships.Rapptz2017-01-201-1/+29
|
* Make ClientUser separate from a regular User.Rapptz2017-01-191-3/+3
| | | | This removes Client.edit_profile in favour of ClientUser.edit.
* Reimplement Guild.me property without patching it in.Rapptz2017-01-181-2/+0
|
* Simple parser for CHANNEL_PINS_UPDATEIan Salmons2017-01-091-0/+5
|
* Allow overriding the shard_ids used for initial shard launch.Rapptz2017-01-081-3/+0
|
* Implement AutoShardedClient for transparent sharding.Rapptz2017-01-071-3/+77
| | | | | This allows people to run their >2,500 guild bot in a single process without the headaches of IPC/RPC or much difficulty.
* Fix variable shadowing in READY parsing.Rapptz2017-01-051-4/+3
|
* Move global user cache to a WeakValueDictionary.Rapptz2017-01-041-1/+5
|
* Fix bug that made member roles go missing.Rapptz2017-01-031-13/+3
|
* Make User and Member messageable.Rapptz2017-01-031-0/+5
|