Kellen
0f18d93e47
Remove unused imports
2022-04-02 04:58:39 -04:00
Stocker
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
chromacoat dreamkey
095aaa9ad1
Change wording of InvalidArgument removal in docs
2022-03-11 23:25:43 -05:00
Josh
147948af9b
Use typing.Self throughout library
2022-03-01 07:53:24 -05:00
Josh
2b69b5d545
Remove discord.InvalidArgument
...
This uses TypeError and ValueError instead.
2022-02-26 01:44:49 -05:00
Josh
4dbe1af32f
Update sphinx and fix documentation issues
2022-02-19 22:35:32 -05:00
jack1142
783513726f
Add support for role icons
...
* Document ROLE_ICONS guild feature
https://github.com/discord/discord-api-docs/pull/3847
* Add support for role icons
https://github.com/discord/discord-api-docs/pull/3847
* Add support for role icon/emoji changes in audit log
https://github.com/discord/discord-api-docs/pull/3847
2022-02-17 11:28:03 -05:00
Rapptz
490bbffc93
Remove in-place edits and return fresh instances instead
...
Fixes #4098
2021-08-23 23:46:50 -04:00
Rapptz
9d4fa0341e
Fix typing of move role position payload parameter
2021-08-23 23:44:20 -04:00
Rapptz
2d7c709235
Rework Role.edit to not rely on previous role state
2021-06-29 22:02:16 -04:00
Rapptz
c475218112
Typehint Role and RoleTags
2021-05-28 08:54:45 -04:00
Rapptz
35bef7af38
Fix Role.is_assignable() computing Guild.me twice
2021-05-28 08:41:45 -04:00
TheOneMusic
9ba5745e68
Check for guild owner in Role.is_assignable()
2021-05-28 08:18:49 -04:00
Tyler
6c8f1ccbdf
Add Role.is_assignable()
2021-05-28 00:53:23 -04:00
Rapptz
1954861668
Add warning for comparing with role positioning
2021-05-27 21:11:17 -04:00
Nadir Chowdhury
757cfad38f
Type up **kwargs of various methods
2021-05-10 20:24:48 -04:00
Rapptz
d85805ab6d
First pass at supporting v8 API
2021-04-11 00:39:13 -04:00
Rapptz
99fc950510
Use f-strings in more places that were missed.
2021-04-08 06:02:47 -04:00
Nadir Chowdhury
89456022cf
Add __all__
to remaining modules
2021-04-07 02:30:32 -04:00
Rapptz
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
Rapptz
272339d5e6
Add support for the new permission serialization scheme.
2021-02-18 07:26:20 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present
2021-01-15 05:28:11 -05:00
Rapptz
e65dab3b23
Implement role tags.
...
This comes with:
* The RoleTags class
* Role.is_premium_subscriber()
* Role.is_bot_managed()
* Role.is_integration()
* Guild.self_role
* Guild.premium_subscriber_role
2020-11-26 01:57:24 -05:00
Michael
93fa46713a
Fix and add documentation
2020-09-23 03:19:35 -04:00
Anurag Singh
5769511779
allow passing color int to role.edit
2020-05-10 19:35:45 -04:00
Saurabh Chaturvedi
3faa9799e3
Fix documentation problem with color
...
At readthedocs.io, for role `color`, it says "Returns the role colour. An alias exists under `color`". This PR fixes that to say "Returns the role color. An alias exists under `colour`".
2020-04-04 02:42:22 -04:00
Rapptz
6071607176
Bump copyright year to 2020
...
Closes #2510
2020-01-19 20:03:00 -05:00
Rapptz
5c0b127c96
Create Permissions and Colour objects when necessary in Role
...
This should have some memory savings of ~24 bytes per role.
* 8 bytes for Permissions
* 8 bytes for Colour
* 8 bytes for the alias
I'm not sure how significant it is but it should be a decent amount.
2019-08-27 18:34:40 -04:00
NCPlayz
3c9bcc2851
Improve documentation
2019-06-07 19:27:46 -04:00
NCPlayz
fb02191b80
Organise documentation
2019-03-19 08:24:42 -04:00
Dante Dam
9656a21ebe
Bumped copyright years to 2019.
2019-01-28 22:22:50 -05:00
Rapptz
77239e4f15
Fix NameError and duplicate insertion bug when moving roles.
2018-09-24 23:55:05 -04:00
Rapptz
95d8bb2e85
Change internal representation of roles in Member and Emoji.
...
Introduce a new internal type, SnowflakeList, which has better memory
footprint over a regular list or set of roles. It is suspected that
there will be a 9x reduction of memory for every Emoji instance and a
48 byte saving per Member instance. However, these savings will
probably only be evident on larger bots.
As a consequence of this change, Member.roles is now computed lazily.
Currently I am not sure if I want to do the initial sorting on the
SnowflakeList for Member, as this comes with a O(n log n) cost when
creating a Member for little purpose since SnowflakeList.has is not
overly relied on. If CPU time becomes an issue this might change.
2018-09-24 22:19:42 -04:00
Rapptz
3d03dbc451
Change internal role storage in Guild to a dict instead of a list.
...
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.
2018-09-24 21:08:48 -04:00
Rapptz
12cb074316
Take the default role property into account when comparing roles.
2018-09-24 20:19:47 -04:00
Hornwitser
c8b49d37be
[lint] Fix incorrect and inconsistent whitespace
...
Adjust whitespace to be consistent with the rest of the library.
2018-08-22 21:43:53 -04:00
Hornwitser
d58fc0ccee
[lint] Remove unused imports
...
Left over from various refactoring and rewrites.
2018-08-22 21:43:50 -04:00
Rapptz
f25091efe1
Drop support for Python 3.4 and make minimum version 3.5.2.
2018-06-10 18:10:00 -04:00
Steve C
0e945915b7
Fixes various documentation errors/inconsistencies
...
Mostly dealing with permissions, also fixes Raw Events inclusion.
2018-05-18 20:25:54 -04:00
Tobotimus
3112e1c17e
Add intersphinx
2018-01-06 17:23:59 -05:00
Rapptz
f4e01b3a92
Make supported operations stand out more than attributes.
2017-05-20 02:08:34 -04:00
Rapptz
f73eb087c9
Use describe instead of tables for supported operations.
2017-05-13 18:48:14 -04:00
Rapptz
dff6bcc745
Add support for audit log reasons.
...
Most routes now have a 'reason' keyword argument.
2017-05-07 03:08:06 -04:00
Rapptz
d24c2a09b6
Change some format usage to use %-formatting.
...
Minor speed increase when we're not doing excessive attribute
access or any type of formatting.
2017-05-04 06:04:55 -04:00
Rapptz
c30ab8a3e5
Fix NameError in Role.edit when moving roles.
2017-04-22 04:47:43 -04:00
Rapptz
fde35848f6
Make Role.members use a list comprehension.
2017-03-25 00:47:51 -04:00
Rapptz
96a43fa9e3
Fix NameError in Role.edit
2017-03-05 06:48:18 -05:00
Rapptz
aa59762c04
Remove extra space.
2017-02-28 17:39:59 -05:00
Rapptz
81baafa1e2
Change Role.is_everyone to Role.is_default.
2017-01-29 20:59:36 -05:00
Rapptz
e77012f4d9
Make all public is_ functions into methods instead of properties.
2017-01-29 20:53:17 -05:00