aboutsummaryrefslogtreecommitdiff
path: root/discord/state.py
Commit message (Collapse)AuthorAgeFilesLines
* Log unknown channel warning in WEBHOOK_UPDATECraftSpider2019-02-181-2/+3
|
* Add guild_integrations_update eventCraftSpider2019-02-181-0/+7
|
* Bumped copyright years to 2019.Dante Dam2019-01-281-1/+1
|
* [lint] Fix import orderHornwitser2018-11-241-8/+10
| | | | | Reorder imports to be consistenly grouped by standard library, third party library, and local modules in that order thoughout the library.
* [lint] Replace equality comparisons to singletonsHornwitser2018-11-241-8/+8
| | | | | | | | Restrict the values accepted by comparisons with booleans to be actual booleans. Minor breaking of undocumented behaviour in permissions; the value to set bits to must be booleans (as indicated by the type error thrown).
* [lint] Rename exception variables to excHornwitser2018-11-241-2/+2
| | | | | Use the more explicit (and common) exc instead of e as the variable holding the exception in except handlers.
* Optimise tight loops in DiscordGateway.received_messageRapptz2018-09-241-1/+12
| | | | | | * type(x) is y is faster than isinstance(x, y) * Re-arrange if-statements for common statements * Drop handler getattr for most events that don't use it
* Optimise some member and user related routines.Rapptz2018-09-241-1/+1
| | | | | | | * Skip user update if possible * Drop copy.copy in favour of manual copy Credit to Hornwitser for these findings.
* Change internal role storage in Guild to a dict instead of a list.Rapptz2018-09-241-4/+3
| | | | | | | | | | | | | | | | This adds the following APIs: * Guild.get_role This removes the following APIs: * Guild.role_hierarchy To compensate for the removed APIs, Guild.roles is now a sorted list based on hierarchy. The first element will always be the @everyone role. This speeds up access at the cost of some memory, theoretically.
* Fix webhook_update from code reviewJeremy Zhang2018-09-151-2/+3
|
* Simple parser for WEBHOOKS_UPDATEJeremy Zhang2018-09-151-0/+4
|
* Ensure large guilds are properly appended to the ready state guild listBryan Forbes2018-08-281-1/+1
|
* [lint] Fix incorrect and inconsistent whitespaceHornwitser2018-08-221-2/+2
| | | | Adjust whitespace to be consistent with the rest of the library.
* [lint] Remove unused variablesHornwitser2018-08-221-2/+2
| | | | Left over from various refactoring and rewrites.
* [lint] Remove unused importsHornwitser2018-08-221-1/+0
| | | | Left over from various refactoring and rewrites.
* Fix crashing with wonky TYPING_START events.Rapptz2018-07-201-1/+1
| | | | Fixes #1439
* Store guild, unavailable tuple in ready as wellkhazhyk2018-06-301-1/+1
| | | | | | This should fix userbots. Fixes: 74380cd ("don't drop guild_available/join before ready")
* don't drop guild_available/join before readykhazhyk2018-06-291-5/+23
| | | | | | | large guilds that recieved GUILD_CREATE events prior to READY would never dispatch guild_available/join. This is inconsistent with smaller guilds and makes these events unreliable. Dispatch the "delayed" guilds after they've been chunked, prior to ready.
* Remove dead package references.Rapptz2018-06-101-1/+1
|
* Drop support for Python 3.4 and make minimum version 3.5.2.Rapptz2018-06-101-26/+21
|
* Remove emojis from cache if they're removed from a guild.Rapptz2018-05-191-0/+2
|
* Change raw events to use slotted data models instead of parameters.Rapptz2018-04-141-34/+38
| | | | | | | | | | This allows for internal changes in Discord to not cause a breaking change every time something changes. Also implements #1214 which adds guild_id to every event where applicable. This is a breaking change.
* Userbots do not have a DM cache cap limit.Rapptz2018-04-021-1/+1
|
* Split Game object to separate Activity subtypes for Rich Presences.Rapptz2018-03-051-4/+8
| | | | | | | | | | | This is a massive breaking change. * All references to "game" have been renamed to "activity" * Activity objects contain a majority of the rich presence information * Game and Streaming are subtypes for memory optimisation purposes for the more common cases. * Introduce a more specialised read-only type, Spotify, for the official Spotify integration to make it easier to use.
* Don't cache webhook users.Rapptz2018-02-241-1/+3
| | | | Fixes #1101
* Change PartialReactionEmoji to PartialEmoji, add a PartialEmojiConverterGorialis2018-01-061-4/+4
|
* Add category support.Rapptz2017-09-131-4/+4
| | | | | | | | | | | | | This adds: * CategoryChannel, which represents a category * Guild.by_category() which traverses the channels grouping by category * Guild.categories to get a list of categories * abc.GuildChannel.category to get the category a channel belongs to * sync_permissions keyword argument to abc.GuildChannel.edit to sync permissions with a pre-existing or new category * category keyword argument to abc.GuildChannel.edit to move a channel to a category
* Fix crashing for now when a category is created.Rapptz2017-09-081-0/+4
| | | | A full implementation will come later.
* 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
|