Rapptz
6071607176
Bump copyright year to 2020
Closes #2510
5 years ago
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.
6 years ago
NCPlayz
3c9bcc2851
Improve documentation
6 years ago
NCPlayz
fb02191b80
Organise documentation
6 years ago
Dante Dam
9656a21ebe
Bumped copyright years to 2019.
6 years ago
Rapptz
77239e4f15
Fix NameError and duplicate insertion bug when moving roles.
7 years ago
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.
7 years ago
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.
7 years ago
Rapptz
12cb074316
Take the default role property into account when comparing roles.
7 years ago
Hornwitser
c8b49d37be
[lint] Fix incorrect and inconsistent whitespace
Adjust whitespace to be consistent with the rest of the library.
7 years ago
Hornwitser
d58fc0ccee
[lint] Remove unused imports
Left over from various refactoring and rewrites.
7 years ago
Rapptz
f25091efe1
Drop support for Python 3.4 and make minimum version 3.5.2.
7 years ago
Steve C
0e945915b7
Fixes various documentation errors/inconsistencies
Mostly dealing with permissions, also fixes Raw Events inclusion.
7 years ago
Tobotimus
3112e1c17e
Add intersphinx
7 years ago
Rapptz
f4e01b3a92
Make supported operations stand out more than attributes.
8 years ago
Rapptz
f73eb087c9
Use describe instead of tables for supported operations.
8 years ago
Rapptz
dff6bcc745
Add support for audit log reasons.
Most routes now have a 'reason' keyword argument.
8 years ago
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.
8 years ago
Rapptz
c30ab8a3e5
Fix NameError in Role.edit when moving roles.
8 years ago
Rapptz
fde35848f6
Make Role.members use a list comprehension.
8 years ago
Rapptz
96a43fa9e3
Fix NameError in Role.edit
8 years ago
Rapptz
aa59762c04
Remove extra space.
8 years ago
Rapptz
81baafa1e2
Change Role.is_everyone to Role.is_default.
8 years ago
Rapptz
e77012f4d9
Make all public is_ functions into methods instead of properties.
8 years ago
Rapptz
ff9f5749e1
Update copyright year to 2017.
8 years ago
Rapptz
f4cadaf0cc
Fix bug with GuildChannel.edit and Role.edit with positions.
I did not update the HTTP code for these two methods.
8 years ago
Rapptz
7eb73cdc71
Add Role.members to get every member with a role.
8 years ago
Rapptz
dceba9d962
Add useful repr to all data classes.
8 years ago
Rapptz
a7a60e433b
Make roles and guilds stateful.
9 years ago
Rapptz
d1d54a468a
Rename Server to Guild everywhere.
9 years ago
Rapptz
45c729b167
Switch IDs to use int instead of str
9 years ago
Rapptz
044b0824e6
Begin working on the rewrite.
9 years ago
Rapptz
b7c90a5e3d
Fix role comparisons.
Fixes #409
8 years ago
Rapptz
13f85b3292
Make Roles totally ordered.
This also fixes a bug with Member.top_role that chose the wrong role
should they have the same position.
9 years ago
Rapptz
b6492a4124
Clarify Role.position documentation.
9 years ago
Rapptz
5016f12079
Add Role.server attribute.
This breaks events that expected a server parameter for the role events.
9 years ago
Rapptz
196e9463f5
Add Role.mentionable attribute.
9 years ago
Rapptz
abb955fdaa
Add Role.mention property
9 years ago
Khazhismel Kumykov
9f722731dd
Fix typo in Role.created_at
9 years ago
Rapptz
2ef38107d8
Add missing created_at properties for other objects.
Such as Channel, PrivateChannel, Object and Role.
9 years ago
Rapptz
8974dffc4e
Change internal update functions to have a leading underscore.
9 years ago
Rapptz
db4cc791dd
Update license of files to 2016.
9 years ago
Rapptz
f1f0e169e4
Add __slots__ where appropriate to data classes.
9 years ago
Rapptz
51d91c2a82
Most data classes now support hashing.
9 years ago
Rapptz
de1c74a399
Make more things into properties.
A lot of the expensive getters were transformed into cached properties
instead. A lot of things that were properties were transformed into
properties as well.
9 years ago
Rapptz
9137d92f67
All data classes now support !=, == and str(obj).
9 years ago
Rapptz
d3fac94e21
Fix bug where Role.is_everyone doesn't propagate in GUILD_ROLE_UPDATE.
9 years ago
Rapptz
17171aaa60
Switch to NumPy style documentation.
9 years ago
Rapptz
85ac03a081
Role.is_everyone actually uses the proper check.
10 years ago
Rapptz
a0073c734e
Split data classes into more files.
10 years ago