aboutsummaryrefslogtreecommitdiff
path: root/discord/user.py
Commit message (Collapse)AuthorAgeFilesLines
* Change User.avatar to be Optional[Asset] instead of AssetRapptz2021-08-251-19/+16
| | | | | | | | | | | This change was needed to allow users to more easily check if an uploaded avatar was set using `if user.avatar:` rather than the admittedly clunky `if user.avatar != user.default_avatar. The old behaviour with a fallback is still useful for actual display purposes, so it has been moved over to the new `User.display_avatar` attribute. This also has symmetry with the newly added `Member.display_avatar` attribute.
* Remove in-place edits and return fresh instances insteadRapptz2021-08-231-2/+10
| | | | Fixes #4098
* Fix user.py typings and reformat fileRapptz2021-08-221-6/+16
|
* Add per-guild member avatar supportJustAnyone2021-08-221-0/+12
| | | Fix #7054
* Fix some type hints in user.pyRapptz2021-08-181-5/+2
|
* Type-hint user.pythetimtoy2021-08-181-34/+65
|
* Fix User.accent_color incorrect attribute accessnickofolas2021-07-301-2/+2
|
* Fix user cache acting incorrectly with evictionsRapptz2021-07-291-1/+1
| | | | | | | | | | | | | | The first issue involved copied users which would lead to user updates causing faster evictions of the cache than was expected. The second issue involved users that weren't bound to an internal lifetime eviction policy. These users would not get evicted. For example, a user without mutual guilds or being part of the internal cache in general (messages, DMs) would never end up being evicted for some strange reason. To handle this case, store_user would get a counterpart named create_user which would create a user without potentially storing them in the cache. That way only users with a bound lifetime within the library would be stored.
* Fix recursive inheritance in BaseUserRapptz2021-07-281-1/+1
|
* Add BaseUser.banner for all subclasses to access new bannersAlex Nørgaard2021-07-281-2/+50
|
* Use a specific tag type for member and user comparisonsRapptz2021-07-081-4/+8
| | | | | | The previous protocol based tag type caused significant overhead (in the magnitude of seconds). Removing this should simplify object creation by removing typing.Generic from the __mro__
* Move global user storage from WeakValueDictionary to dictRapptz2021-07-071-1/+18
| | | | | | | | | | | | 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.
* Rework User.edit to have proper typingRapptz2021-06-291-6/+9
|
* Remove extraneous __slots__ assignmentsRapptz2021-06-281-2/+2
|
* Type up **kwargs of various methods Nadir Chowdhury2021-05-101-4/+3
|
* Typehint WidgetJosh2021-05-091-0/+9
|
* Clarify ClientUser.verified docsDavid2021-04-301-1/+1
|
* Remove lingering User.avatar documentationRapptz2021-04-191-4/+0
|
* Add missing reprs to some objectsSteve C2021-04-171-0/+6
| | | These are WidgetMember, BaseUser, and DeletedReferencedMessage
* Rewrite Asset designRapptz2021-04-161-57/+11
| | | | | | | | | | | | | | | | | | | | | | | This is a breaking change. This does the following transformations, assuming `asset` represents an asset type. Object.is_asset_animated() => Object.asset.is_animated() Object.asset => Object.asset.key Object.asset_url => Object.asset_url Object.asset_url_as => Object.asset.replace(...) Since the asset type now requires a key (or hash, if you will), Emoji had to be flattened similar to how Attachment was done since these assets are keyed solely ID. Emoji.url (Asset) => Emoji.url (str) Emoji.url_as => removed Emoji.url.read => Emoji.read Emoji.url.save => Emoji.save This transformation was also done to PartialEmoji.
* Remove User.permissions_inRapptz2021-04-111-16/+0
| | | | This seemed to only cause confusion.
* Use f-strings in more places that were missed.Rapptz2021-04-081-8/+12
|
* Add `__all__` to remaining modulesNadir Chowdhury2021-04-071-0/+5
|
* Convert datetimes to aware datetimes with UTC.Rapptz2021-04-041-1/+2
| | | | | Naive datetimes will now be interpreted as local time throughout the library.
* Remove userbot functionalityRapptz2021-04-041-551/+7
| | | | | 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`.
* deprecate User.relationshipsNadir Chowdhury2021-03-281-0/+2
|
* Update create_dm documentation to say it's a coroutineAlex Nørgaard2021-03-241-1/+3
|
* Code optimisations and refactoring via SourceryNadir Chowdhury2021-02-241-5/+1
|
* Deprecate non-bot methodsNadir Chowdhury2021-02-231-0/+52
|
* Add User.mutual_guildssudosnok2021-02-201-0/+12
|
* Fix User public flags not updatingLucas2021-01-171-0/+1
|
* Change copyright year to presentNihaal Sangha2021-01-151-1/+1
|
* Fix and add documentationMichael2020-09-231-3/+13
|
* Documentation formattingSkezza2020-06-301-1/+1
|
* Fix various inconsistencies within the documentation (#5067)Sebastian Law2020-06-281-2/+2
|
* Fix incorrect class reference in documentationJohnyTheCarrot2020-06-041-1/+1
|
* Add support for public user flagsJohnyTheCarrot2020-05-291-1/+8
|
* Fix colour properties being displayed as methods in the documentation.kittenswolf2020-05-031-2/+2
|
* Fixes and improvements for v1.3 documentationHarmon2020-01-221-0/+3
| | | | | | | | | * Add missing versionadded strings for v1.3 * Add missing versionchanged string for Message.edit * Consistently use versionadded for attributes * Consistently use versionchanged for parameters * Use versionchanged for Bot.is_owner * Fix references in v1.3 changelog * Improve grammar in v1.3 changelog
* Bump copyright year to 2020Rapptz2020-01-191-1/+1
| | | | Closes #2510
* Add Profile.system and Profile.team_user to query newer flagsRapptz2019-12-211-0/+8
|
* Add User.system and MessageFlags.urgentRapptz2019-12-211-1/+6
|
* Return 'username' instead of 'name'Merlintor2019-12-051-1/+1
|
* Adjust BASE urls to have no trailing slash (consistency)Devon R2019-11-151-1/+1
|
* Return invites as https, various URL normalizationDevon R2019-11-151-1/+1
|
* Added Optional to ClientUser.premium_type type hintWilly2019-11-151-1/+1
|
* Disambiguate and normalize documentation for non-bot only methodsTyler2019-08-111-15/+15
|
* Fix: another capitalization issue in docstringReece Dunham2019-07-181-1/+1
|
* Fix return type docstring for BaseUser.default_avatarSteve C2019-07-181-1/+1
|