Commit Graph

86 Commits

Author SHA1 Message Date
44a44e938f Reformat entire project with ruff instead of black 2025-08-18 20:16:10 -04:00
6ec2e5329b Deprecate with_expiration param in fetch_invite 2025-08-12 03:18:24 -04:00
774b934f74 Add support for guest invites 2025-07-02 18:59:40 -04:00
4862ea22fd Return invites when deleting them via Invite.delete or Client.delete_invite 2025-06-20 15:03:29 -04:00
8953938a53 Update Pyright to v1.1.394 2025-02-18 03:29:09 -05:00
b9dc85e6f7 Add type attribute to Invite 2024-05-17 13:31:26 -04:00
630b2a1e55 Update pyright version 2023-07-01 18:26:27 -04:00
d7b6a2ad12 Fix usage of single backticks to links and code-blocks 2022-10-26 04:26:56 -04:00
ce06beeb6c Fix permissions-based docstrings to be more consistent 2022-09-17 14:07:39 -04:00
dc81ff76c4 Add Object.type to Objects where a type can be determined 2022-08-09 08:18:58 -04:00
6a4d5eef52 Fix documentation errors in discord.Invite and on_integration_update 2022-06-01 02:36:51 -04:00
5ffa3e85de Update comments after # type: ignore to be compatible with PEP 484 2022-03-27 22:26:34 -04:00
5aa696ccfa Fix typing issues and improve typing completeness across the library
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-03-13 23:52:10 -04:00
5ff657dbec Add missing attributes in PartialInviteGuild 2022-03-10 05:39:03 -05:00
147948af9b Use typing.Self throughout library 2022-03-01 07:53:24 -05:00
3c6279b947 Implement Guild Scheduled Events 2022-03-01 01:00:04 -05:00
ecf239d2a2 Fix user cache acting incorrectly with evictions
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.
2021-07-29 01:43:23 -04:00
dd8168f902 Fix a typo within the documentation 2021-07-28 19:54:58 -04:00
d78e5d979d Refactor and type hint invites 2021-05-29 05:49:19 -04:00
b48f510e15 Add invite targets for voice channel invites 2021-05-29 00:15:46 -04:00
9b4e820bbe Document Invite.inviter as optional 2021-05-12 20:34:44 -04:00
3864fb37a0 Fix various reference issues in documentation
Co-Authored-By: Riley Shaw <30989490+ShineyDev@users.noreply.github.com>
2021-05-06 07:51:07 -04:00
e762f55847 Add fetch_invite with with_expiration 2021-05-01 07:46:16 -04:00
67abfea61a Add target_user and target_type to Invite objects 2021-04-21 23:30:35 -04:00
f4165755a9 Rename lingering _url Asset properties 2021-04-21 23:24:36 -04:00
9eaf1e85e4 Rewrite Asset design
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.
2021-04-16 11:27:23 -04:00
1efdef3ac3 Add typings for invites, templates, and bans 2021-04-10 02:55:10 -04:00
99fc950510 Use f-strings in more places that were missed. 2021-04-08 06:02:47 -04:00
89456022cf Add __all__ to remaining modules 2021-04-07 02:30:32 -04:00
ff7094ce96 Convert datetimes to aware datetimes with UTC.
Naive datetimes will now be interpreted as local time throughout
the library.
2021-04-04 23:54:08 -04:00
94bd1b9822 Convert two missing places to f-strings 2021-04-04 07:17:03 -04:00
9d39b135f4 Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by
default. It also changes some methods to use `yield from`.
2021-04-04 07:03:53 -04:00
6c40e3b837 Update docs for discord.Invite.max_uses
This mentions the unlimited uses aspect.
2021-02-28 23:35:05 -05:00
69bdc3a184 Change copyright year to present 2021-01-15 05:28:11 -05:00
92fffb5daa Revert "Fix table wrapping"
This reverts commit c911cd0dbd.
2020-12-18 21:18:54 -05:00
df57392aea Fix table wrapping 2020-12-18 21:18:54 -05:00
7f17dc79a6 Remove namedtuples to better future guard the library 2020-09-21 03:36:58 -04:00
c3bca7ec73 Documentation formatting 2020-06-30 23:32:00 -04:00
b4b953bfc6 Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
08af907807 Change PartialInviteGuild.icon_url_as to mimic Guild.icon_url_as 2020-06-26 22:52:36 -04:00
0033cc83ef Fix fetching invites on guilds the user is not in 2020-01-25 03:29:14 -05:00
6ed0ae7d96 Fix fetching invites for a GroupChannel.
Closes #2394
Fixes #2383
2020-01-20 07:14:27 -05:00
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
7b2c01c48a Add support for on_invite_create and on_invite_delete 2020-01-17 19:20:53 -05:00
bf9b9c5879 Adjust BASE urls to have no trailing slash (consistency) 2019-11-15 04:25:38 -05:00
f5ebf42e1f Return invites as https, various URL normalization 2019-11-15 04:25:38 -05:00
3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
2cd6d771ec Make __repr__ slightly more detailed and add a few missing ones.
This includes raw events (which didn't have any) and a few other
types that were missing them. Upon review some more useful fields were
added to the repr output which would be more useful during debugging.
2019-05-26 02:32:47 -04:00
964b97aa30 Add table showing what methods get invite attributes. 2019-05-19 19:17:30 -04:00
bf5b267c55 Correct the documentation for methods and properties that return Assets 2019-05-14 19:13:48 -04:00