aboutsummaryrefslogtreecommitdiff
path: root/discord/state.py
Commit message (Collapse)AuthorAgeFilesLines
* Do not overwrite members that are already in cache during chunking.Rapptz2016-02-171-1/+2
|
* Remove request_offline option.Rapptz2016-02-141-10/+7
|
* Update owner references when we get a chunk.Rapptz2016-02-141-0/+4
|
* Offline members are now added by default automatically.Rapptz2016-02-141-6/+54
| | | | | This commit adds support for GUILD_MEMBERS_CHUNK which had to be done due to forced large_threshold requirements in the library.
* Handle case where PRESENCE_UPDATE adds members to cache.Rapptz2016-02-131-21/+31
| | | | | | | | When we don't request offline members, members that are going from offline to online in the server will become available via the PRESENCE_UPDATE event. This should be transparent to the user since technically the member exists in the server and thus on_member_update is used instead of on_member_join.
* Add Server.member_count property for actual member count.Rapptz2016-02-131-0/+2
| | | | This will always work regardless of chunking or not.
* Fix cases where Member.roles would have a string instead of Role.Rapptz2016-02-011-1/+8
| | | | Fixes #81.
* Update the unavailable guild's data when it becomes available.Rapptz2016-01-211-3/+4
|
* Guild member add will include deaf and mute now, do not provide default valuesKhazhismel2016-01-121-1/+1
|
* Handle cases where people put False-like values for game presences.Rapptz2016-01-111-2/+2
|
* Change internal update functions to have a leading underscore.Rapptz2016-01-111-2/+2
|
* document public get_ methods and make others privateSteven Berler2016-01-081-35/+35
|
* performance improvementsSteven Berler2016-01-081-57/+76
| | | | | | | | | | | | | | | | | | | | | Replaced server member lists, channel lists, and private channel lists with dicts. This allows O(1) lookups and removes (previously it would be an O(N) operation to lookup or remove). I did pretty extensive testing and benchmarking to compare the performance of using lists vs using dicts. Iterating through lists to find an item is only faster in the average case for extremely small lists (less than 3 items). For 100 items, using a dict is about 10 times faster on average (and about 100 times faster for 1000 items). The overhead in dicts is in memory usage and initial creation time. Creating and populating a dict is about 2 to 3 times slower than creating and appending items to a list. However this cost is still tiny. For 1000 items this equates to about a 70 microsecond difference (on an i7 CPU) for populating the entire dict. The memory overhead for a dict (compared to a list) is about 25-60 KB per 1000 items (can vary depending on dict resizing). Originally I wanted to use OrderedDicts to presereve order, but in my testing OrderedDicts have about 6x the memory overhead compared to normal dicts.
* Fix handling of embed-only MESSAGE_UPDATE.Rapptz2016-01-071-1/+6
|
* Change the way MESSAGE_UPDATE events are handled.Rapptz2016-01-071-11/+1
| | | | | | | | Previously we created a copy of the object and did some strange iteration over the data and set the attributes that we thought were valid. This worked back then in v0.1.0 of the library when it was written, but it no longer works nowadays when we want to be as future proof as possible.
* Unavailable guilds get added to cache.Rapptz2016-01-061-2/+0
|
* Update license of files to 2016.Rapptz2016-01-041-1/+1
|
* ConnectionState is now constructed in Client.__init__.Rapptz2015-12-291-3/+5
| | | | | | This should reduce the amount of checks for None if someone doesn't want a websocket connection. The connection state is instead cleared rather than reconstructed.
* Add game data class, replace game_id.Khazhismel2015-12-231-1/+3
|
* Delete messages from message cache when you leave the server.Rapptz2015-12-191-1/+9
|
* Add __slots__ where appropriate to data classes.Rapptz2015-12-191-1/+0
|
* Add on_member_ban and on_member_unban events.Rapptz2015-12-171-0/+20
| | | | Fixes #58.
* Remove on_status event. Superseded by on_member_update.Rapptz2015-12-171-2/+1
|
* All update related events now pass in the previous state.Rapptz2015-12-171-6/+10
|
* Add Server.me attribute to access the Member version of Client.user.Rapptz2015-12-161-0/+1
|
* Make more things into properties.Rapptz2015-12-161-2/+2
| | | | | | A lot of the expensive getters were transformed into cached properties instead. A lot of things that were properties were transformed into properties as well.
* Fix GUILD_ROLE_DELETE triggering ValueError.Rapptz2015-12-141-5/+12
|
* avoid potential bug when creating new private msgsSteven Berler2015-12-131-2/+3
| | | | | | | | | It probably isn't good to rely on an item that was added to a list to still be the last item, especially if we could have other async coroutines modify the list. This may not be an actual issue, but having the function explicitly return the object that it just added to the list should guarantee that we don't accidentally pull the wrong item from the end of the list later.
* Fix issue with member.roles being empty.Rapptz2015-12-081-1/+2
|
* Handle GUILD_UPDATERapptz2015-12-061-0/+7
|
* Add enumerators instead of strings.Rapptz2015-12-041-0/+5
| | | | Changes channel type, status and server region into 3.4 enums.
* Begin working on asyncio port.Rapptz2015-12-041-0/+295