aboutsummaryrefslogtreecommitdiff
path: root/discord/state.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Move message creation to a factory method inside ConnectionState.Rapptz2017-01-031-20/+21
|
* Move away from StateContext and use ConnectionState directly.Rapptz2017-01-031-23/+17
|
* Add delete_after parameter to MessageChannel.sendRapptz2017-01-031-2/+2
|
* Absolute import some circular dependencies to appease Python 3.4.Rapptz2017-01-031-18/+20
|
* Change dict value views into lists.Rapptz2017-01-031-3/+3
|
* Re-add support for reactions.Rapptz2017-01-031-66/+49
| | | | | We now store emojis in a global cache and make things like adding and removing reactions part of the stateful Message class.
* Rename try_insert_user to store_userRapptz2017-01-031-7/+7
|
* Make emojis and members stateful.Rapptz2017-01-031-2/+3
|
* Make roles and guilds stateful.Rapptz2017-01-031-2/+2
|
* Rename Server to Guild everywhere.Rapptz2017-01-031-138/+138
|
* Split channel types.Rapptz2017-01-031-18/+22
| | | | | | | | | | | This splits them into the following: * DMChannel * GroupChannel * VoiceChannel * TextChannel This also makes the channels "stateful".
* Switch IDs to use int instead of strRapptz2017-01-031-41/+38
|
* Optimise VoiceState for memory.Rapptz2017-01-031-12/+13
| | | | | | Instead of storing one VoiceState per Member, only store them if necessary. This should bring down the number of instances significantly.
* Begin working on the rewrite.Rapptz2017-01-031-54/+39
|
* Chunk every guild if it's a user bot.Rapptz2016-12-241-3/+4
| | | | | This also increases the timeout for chunking by 30 seconds for every chunk we're waiting for.
* Properly propagate loop. Fixes #420.Rapptz2016-12-211-3/+6
|
* Timeout waiting for chunking.Rapptz2016-12-161-4/+10
| | | | | | 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.
* Fix crash on duplicate or out of order reactions.khazhyk2016-11-301-2/+5
| | | | Eventual consistency ftw
* Support MESSAGE_REACTION_REMOVE_ALL event.Rapptz2016-11-211-0/+7
|
* Fix crash on reaction remove.khazhyk2016-11-051-1/+1
| | | | | | | | Discord can sometimes send integer 0 as the emoji id instead of null to signify a non-custom emoji, which was causing a crash due to a 'is not None' check assuming the reaction was for an emoji with id 0. Probably a discord bug, but preferable to handle here rather than crash users.
* Change reaction events signature and name.Rapptz2016-11-031-2/+2
| | | | | | | | | This changes the event signature to be (reaction, user) instead of (message, reaction, user) since the reaction data class already has the message being reacted to as a member. The name was shortened from on_message_reaction_ to on_reaction_ since the message prefix was deemed redundant.
* Inject full Emoji to Reaction if we have it.khazhyk2016-11-031-14/+31
| | | | | | | Reaction objects with custom Emoji are partial. If we know of this Emoji (can find it on this client) then inject it. Otherwise, leave it as a hollow Emoji. We can still react with a hollow Emoji, but can't get other metadata about it.
* Add support for reactions.khazhyk2016-10-271-0/+55
| | | | | | | | | | | Reactions can be be standard emojis, or custom server emojis. Adds - add/remove_reaction - get_reaction_users - Messages have new field reactions - new events - message_reaction_add, message_reaction_remove - new permission - add_reactions