aboutsummaryrefslogtreecommitdiff
path: root/discord/abc.py
Commit message (Collapse)AuthorAgeFilesLines
* Bumped copyright years to 2019.Dante Dam2019-01-281-1/+1
|
* [lint] Fix import orderHornwitser2018-11-241-1/+0
| | | | | Reorder imports to be consistenly grouped by standard library, third party library, and local modules in that order thoughout the library.
* [lint] Remove redundant exception variablesHornwitser2018-11-241-2/+2
| | | | | | Use bare raise statement when reraising the exception that occured, and remove unused exception variables. Also remove a pointless exception handler in discord.opus.
* [lint] Limit unneccessarily broad except clausesHornwitser2018-11-241-4/+4
| | | | Add exception qualifier(s) to bare except clauses swallowing exceptions.
* Change internal representation of roles in Member and Emoji.Rapptz2018-09-241-2/+9
| | | | | | | | | | | | | | | 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.
* Change internal role storage in Guild to a dict instead of a list.Rapptz2018-09-241-3/+3
| | | | | | | | | | | | | | | | 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.
* Add support for Discord's slow mode.Rapptz2018-09-141-0/+5
| | | | | | | Adds the following: * `slowmode_delay` for `TextChannel.edit` * `slowmode_delay` attribute for `TextChannel`
* Change docstrings to raw-stringsBeatButton2018-09-141-1/+1
|
* [lint] Fix incorrect and inconsistent whitespaceHornwitser2018-08-221-2/+2
| | | | Adjust whitespace to be consistent with the rest of the library.
* [lint] Remove unused variablesHornwitser2018-08-221-1/+1
| | | | Left over from various refactoring and rewrites.
* Remove dead package references.Rapptz2018-06-101-1/+1
|
* Drop support for Python 3.4 and make minimum version 3.5.2.Rapptz2018-06-101-62/+36
|
* Fixes various documentation errors/inconsistenciesSteve C2018-05-181-4/+7
| | | | Mostly dealing with permissions, also fixes Raw Events inclusion.
* abc.GuildChannel.set_permissions can raise NotFound.Rapptz2018-05-181-0/+2
| | | | Fix #1254
* Add intersphinxTobotimus2018-01-061-11/+11
|
* Don't use Bulk Channel Edit endpoint if not actually moving channels.Rapptz2017-09-241-1/+4
| | | | | | Should make the category-only edit cases more straightforward since it does not rely on other guilds in the cache, outside of the category itself.
* Properly handle cases where a category is removed.Rapptz2017-09-211-1/+1
|
* Fix grammar in abc docs, add new implementationSteve C2017-09-131-4/+5
|
* Add category support.Rapptz2017-09-131-3/+48
| | | | | | | | | | | | | This adds: * CategoryChannel, which represents a category * Guild.by_category() which traverses the channels grouping by category * Guild.categories to get a list of categories * abc.GuildChannel.category to get the category a channel belongs to * sync_permissions keyword argument to abc.GuildChannel.edit to sync permissions with a pre-existing or new category * category keyword argument to abc.GuildChannel.edit to move a channel to a category
* Remove reason keyword argument from message deletion.Rapptz2017-08-151-5/+2
| | | | | | | | | | | Apparently this is unsupported. Affected functions include: * abc.Messageable.send * Message.delete * TextChannel.delete_messages * TextChannel.purge
* Remove GuildChannel.is_defaultSinisterRectus2017-08-081-11/+1
|
* Add documentation examples for AsyncIterator and change_presence.Gorialis2017-08-081-2/+1
|
* Handle everyone role having top priority in permission resolution.Rapptz2017-07-071-2/+13
| | | | | | | | | | | | In Discord, if the @everyone role has an explicit allow but a later role has an explicit deny, the permission is denied rather than allowed despite the fact that on Discord, allows have a higher priority than denies. This is because the @everyone role is supposed to be the first role to be applied, while the rest could be applied in an aggregate fashion. Fixes #630.
* Rename AsyncIterator.get to next to prevent shadowing.Rapptz2017-07-041-1/+1
|
* Allow sending files list smaller than 2 elements in Messageable.sendBeatButton2017-06-071-4/+3
| | | | The previous restriction was unwarranted.
* Support for sending a nonce.Rapptz2017-05-311-4/+8
|
* Force disconnect in abc.Connectable.connect.Rapptz2017-05-131-1/+1
| | | | | Some cases of is_connected is not set so we need to force it to clear it anyway.
* First pass at documentation reform.Rapptz2017-05-121-1/+89
|
* Rename abc.Callable to abc.Connectable.Rapptz2017-05-101-1/+1
|
* Add support for audit log reasons.Rapptz2017-05-071-11/+24
| | | | Most routes now have a 'reason' keyword argument.
* Change some format usage to use %-formatting.Rapptz2017-05-041-1/+1
| | | | | Minor speed increase when we're not doing excessive attribute access or any type of formatting.
* Fix NameError in GuildChannel.changed_rolesRapptz2017-04-221-0/+1
|
* Better handling of VOICE_SERVER_UPDATE.Rapptz2017-04-181-4/+3
| | | | | | This now sort of respects "Awaiting Endpoint..." waiting. I haven't actually tested out this case since it's hard to get it. However this new code does work with the regular connection flow.
* Re-implement voice sending.Rapptz2017-04-181-3/+66
| | | | | | | | | | | | | | | | | | | | This is a complete redesign of the old voice code. A list of major changes is as follows: * The voice websocket will now automatically reconnect with exponential back-off just like the regular Client does. * Removal of the stream player concept. * Audio now gracefully pauses and resumes when a disconnect is found. * Introduce a discord.AudioSource concept to abstract streams * Flatten previous stream player functionality with the VoiceClient, e.g. player.stop() is now voice_client.stop() * With the above re-coupling this means you no longer have to store players anywhere. * The after function now requires a single parameter, the error, if any existed. This will typically be None. A lot of this design is experimental.
* Add support for multiple file attachments.Rapptz2017-04-081-29/+35
| | | | | | | This is a breaking change. No longer does Messageable.send have a filename keyword argument, instead this is all handled through the discord.File model. To upload many files you must specify a list of discord.File objects.
* Removing acking on channels.Rapptz2017-03-181-22/+0
|
* Handle case when guild owner somehow doesn't exist in permissions_forRapptz2017-03-151-1/+2
|
* Add Messageable.ackRapptz2017-02-281-0/+22
|
* Move purge and delete_messages from Messageable.Rapptz2017-02-261-144/+1
| | | | | | This is a breaking change. Move these two to TextChannel since the other things that implement Messageable cannot reliably do bulk delete actions in their respective channels.
* Fall back to single message delete in Messageable.purgeRapptz2017-02-231-9/+30
| | | | | | Also make it work on user accounts. Fixes #456.
* Fix NameError in GuildChannel.overwrites_forRapptz2017-02-171-2/+2
|
* Add support for limit=None in Messageable.history.Rapptz2017-02-131-1/+3
| | | | Fixes #480.
* Implement utilities for AsyncIterator.Rapptz2017-02-111-1/+1
| | | | Closes #473.
* Fix support for instant invites.Rapptz2017-02-081-0/+68
|
* Make all public is_ functions into methods instead of properties.Rapptz2017-01-291-2/+1
|
* Update copyright year to 2017.Rapptz2017-01-201-1/+1
|
* Fix bug with GuildChannel.edit and Role.edit with positions.Rapptz2017-01-161-3/+3
| | | | I did not update the HTTP code for these two methods.
* Remove _get_guild_id from Messageable ABC.Rapptz2017-01-141-10/+4
|
* Fix documentation to properly use Messageable.sendRapptz2017-01-131-1/+1
|
* Fix NameError inside Messageable.get_messageRapptz2017-01-111-1/+1
|