aboutsummaryrefslogtreecommitdiff
path: root/discord/state.py
Commit message (Collapse)AuthorAgeFilesLines
* Refactor utcfromtimestamp to use fromtimestamp(..., tz=utc)Rapptz2021-07-091-2/+1
|
* Change WEBHOOK_UPDATE to use guild information from gatewayRapptz2021-07-081-1/+6
| | | | | | This changes the lookup from unnecessary O(n) to two amortised O(1) lookups. This event pretty much always has a guild_id so the original code was always a performance bottleneck.
* Change CHANNEL_PINS_UPDATE to use guild information from gatewayRapptz2021-07-081-7/+9
| | | | This changes the channel lookup from O(n) to two amortised O(1) lookups
* Remove calls to gc.collect in ConnectionStateRapptz2021-07-071-18/+0
| | | | | For some bots this was actually a performance bottleneck, might as well remove it if it causes bad performance
* Move global user storage from WeakValueDictionary to dictRapptz2021-07-071-5/+26
| | | | | | | | | | | | Profiling showed that WeakValueDictionary caused rather significant and noticeable slowdowns during startup. Since the only thing it was used for was to automatically remove the key from the mapping when the reference count reaches zero, the same could theoretically be accomplished by using the __del__ special method. There is a chance that this could lead to a memory leak since the __del__ method is not always called, but the only instances of this happening are during interpreter shutdown to my knowledge and at that point the mapping is the least of my concern.
* Separate member_update and presence_update eventsRapptz2021-07-041-1/+1
|
* Fix Client.fetch_channel not returning ThreadAlex Nørgaard2021-07-031-2/+2
|
* Fix Interaction.channel being None in threadsNadir Chowdhury2021-07-011-3/+3
|
* Set Message.guild from guild_id if unavailable through Message.channelLilly Rose Berner2021-06-281-1/+1
|
* Dispatch thread_join when a thread is updated but not in cacheRapptz2021-06-281-0/+4
|
* Refactor Guild to support type hintsRapptz2021-06-081-0/+1
| | | | | | | | | | | | This patch also does the following: * Sets some parameters to be positional only * Changes Guild.edit to use the MISSING sentinel * Changes the various create_channel methods to be type safe * Changes many parameters from Optional[T] to use MISSING * Changes Guild.create_role to use MISSING sentinel This refactor is mostly partial but lays a decent foundation
* Allow pins events to work with threadsRapptz2021-06-081-1/+1
|
* Don't dispatch thread_join on extraneous THREAD_CREATE dispatchesRapptz2021-06-081-2/+4
|
* Parse remaining thread events.Rapptz2021-06-081-5/+50
|
* Add minor parsing for THREAD_LIST_SYNC and THREAD_MEMBER_UPDATERapptz2021-06-081-3/+46
| | | | There's no dispatch for these yet
* Allow Message.channel to be a threadRapptz2021-06-081-2/+2
|
* First pass at preliminary thread supportRapptz2021-06-081-1/+40
| | | | | This is missing a lot of functionality right now, such as two gateway events and all the HTTP CRUD endpoints.
* Add support for integration create/update/delete eventsNadir Chowdhury2021-06-071-0/+30
|
* Add Client.persistent_views to get all persistent viewsRapptz2021-05-311-0/+4
|
* Remove view syncing before editing in viewsRapptz2021-05-311-0/+3
| | | | | This prevents a potential race condition when a MESSAGE_UPDATE is received syncing and refreshing the view components causing a desync.
* Implement StageInstanceNadir Chowdhury2021-05-301-0/+35
|
* Add support for select componentsRapptz2021-05-281-1/+1
|
* Add initial support for buttons and componentsRapptz2021-05-271-0/+13
|
* Add support for ApplicationFlagsNadir Chowdhury2021-04-181-1/+3
|
* Fix guild.chunk() not working on evicted guildsSteve C2021-04-141-0/+3
| | | | If you're trying to chunk a guild that the bot is not in, it'll just hang on the chunk coro forever. It's weird, I know.
* Remove fetch_offline_members param for Clientapple502j2021-04-141-9/+1
|
* Remove support for guild subscriptions apple502j2021-04-141-1/+0
|
* Remove superfluous unused payload parameterRapptz2021-04-111-1/+1
|
* Create temporary DMChannels from message create eventsRapptz2021-04-111-3/+3
| | | | | | | | | | This allows for DMChannels to work without falling back to the Object error case since there is enough information to build a pseudo DMChannel object. This is a breaking change since it changes the type of DMChannel.recipient to Optional[User] for when this faux object is created.
* Remove `private_channel_(delete/create)` eventsNadir Chowdhury2021-04-111-22/+8
|
* Remove Member related handling in PRESENCE_UPDATERapptz2021-04-111-10/+6
|
* First pass at supporting v8 APIRapptz2021-04-111-6/+0
|
* Fix some regressions from create_task changeRapptz2021-04-061-1/+1
|
* Add on_interaction event and Interaction class.Rapptz2021-04-061-0/+5
| | | | | This is the first pass at the functionality. It's currently a bit incomplete.
* Add support for setting application_idRapptz2021-04-061-0/+17
|
* Use `asyncio.create_task` over `asyncio.ensure_future`Nadir Chowdhury2021-04-051-6/+6
|
* Convert datetimes to aware datetimes with UTC.Rapptz2021-04-041-0/+1
| | | | | Naive datetimes will now be interpreted as local time throughout the library.
* Remove userbot functionalityRapptz2021-04-041-98/+28
| | | | | This has a lot of legacy and cruft so there may be some stuff I've missed but this first pass is enough to get a clear separation.
* Modernize code to use f-stringsRapptz2021-04-041-4/+2
| | | | | This also removes the encoding on the top, since Python 3 does it by default. It also changes some methods to use `yield from`.
* Code optimisations and refactoring via SourceryNadir Chowdhury2021-02-241-5/+4
|
* Use member provided data in typing_start event if not in cacheRapptz2021-01-241-0/+5
| | | | | | Apparently Discord had this all along. ref: #5965, #5983
* Change copyright year to presentNihaal Sangha2021-01-151-1/+1
|
* Dispatch user updates if the global cache gets stale in update eventsRapptz2021-01-071-0/+6
|
* Implement presences for `Guild.query_members`Nadir Chowdhury2020-12-311-6/+17
|
* remove extraneous assignmentSebastian Law2020-12-221-2/+0
|
* [chore] Remove redundant importsNadir Chowdhury2020-11-281-2/+0
| | | This also removes the historical patch for NullHandler implemented in bbf1c54, as it has been available since Python 3.1.
* Ensure member key is not overwritten by author key in MESSAGE_UPDATERapptz2020-11-231-0/+3
| | | | | | | This also coerces the older message to take the member data from the newer message so the types are not incompatible. Fix #5999
* Don't store a user cache if there's no member intent or cache is offRapptz2020-11-231-0/+6
| | | | | | | Without a cache or member intent the user cache can get out of date with no events to update the underlying user in the member object. Ref: #6034
* Fix error with templates not having access to member cache flags.Rapptz2020-11-211-6/+6
| | | | | | This also changes the attribute from having an underscore Fix #5986
* Fix error when querying members from the gateway.Rapptz2020-10-191-2/+1
| | | | I accidentally made this return True instead of the actual member list