aboutsummaryrefslogtreecommitdiff
path: root/discord/abc.py
Commit message (Collapse)AuthorAgeFilesLines
* Don't use a namedtuple for _OverwritesRapptz2020-07-081-2/+16
| | | | Fix #5109
* Drop superfluous zero in version related changes in the documentationRapptz2020-01-211-1/+1
|
* Bump copyright year to 2020Rapptz2020-01-191-1/+1
| | | | Closes #2510
* Fix bug preventing movement of channels when there are gaps in positionRapptz2020-01-121-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original code was too aggressive in ensuring that the channel positions are correct and within bounds. Unfortunately, for Discord this number is merely a guess and there can be gaps that cause the position number to be greater than the number of channels currently in that sorting bucket. One such example of this is when a channel is deleted and created. When this happens, the positions are not updated (presumably because Discord considers this to be too expensive). Sadly this means that if a user were to create a channel, delete a channel, and then create another one then there will be gaps in the position sequence. More concretely, consider the following example: Channels with position [0, 1, 2, 3, 4]. A new channel is created so it inherits the maximum position giving us [0, 1, 2, 3, 4, 5]. We delete a channel that's smaller than the maximum so our list now looks like [0, 1, 2, 4, 5]. Next time we create a channel we will further increment the gap, giving us [0, 1, 2, 4, 5, 6]. If a user would want to move the channel with position 4 to be after position 6 (so in this case that value would 7) then the library would erroneously raise an error because it assumed too much about the data integrity. Luckily, the library upon actually doing the request fixes the channel positions so everything goes back to normal like it was intended. That is to say, [0, 1, 2, 3, 4, 5].
* Allow editing of overwrites in Channel.edit()CapnS2019-12-041-0/+22
|
* Return invites as https, various URL normalizationDevon R2019-11-151-1/+1
|
* Make permissions_synced actually return Falseapple502j2019-08-271-1/+1
| | | The code before this returned None when there is no category.
* Add versionadded string to GuildChannel.permissions_syncedRapptz2019-08-271-0/+2
|
* Add permissions_synced to abc.GuildChannelCapn2019-08-271-0/+10
| | | | This allows users to check whether or not the permissions for a Guild Channel are synced with the permissions for its category. Discord automatically syncs the permissions when the overwrites are equal so just checking if the two overwrites are equal will determine if they are synced.
* Explicitly mention discord.Object in abc.Snowflake documentation.Rapptz2019-08-111-0/+3
|
* abc.Messageable do not have to implement abc.SnowflakeRapptz2019-07-271-2/+0
| | | | Fix #2290
* Use lower level Guild.owner_id for permission resolution.Rapptz2019-07-101-2/+1
|
* fix documentation for GuildChannel.set_permissionsXua2019-06-291-2/+3
|
* Update Sphinx to 2.1.2Rapptz2019-06-281-29/+29
|
* Publicly expose a type property for all channels.Rapptz2019-06-091-1/+1
| | | | Fix #2185
* Improve documentationNCPlayz2019-06-071-96/+101
|
* Ensure message links resolve in the Messageable.pins note.Rapptz2019-05-271-2/+2
|
* Add note that Messageable.pins does not contain Message.reactionsRapptz2019-05-271-0/+6
| | | | Fix for #2189
* Fix pluralization errors in various filesEhren Julien-Neitzert2019-05-231-1/+1
| | | | | * Replaced instances of 'return an' with 'returns an' * fixed pluralization errors
* Fixed a typo in GuildChannel.overwrites docstringDevilXD2019-04-291-1/+1
|
* Explicit namespacing in the PermissionOverwrite example.Rapptz2019-04-191-1/+1
| | | | Apparently some people get confused by this.
* Add abc.GuildChannel.clone to clone a channel with another name.Rapptz2019-04-181-0/+40
| | | | Fixes #2093
* Add delay kwarg to message.delete()Vexs2019-04-181-7/+1
| | | | Refactor delete_after kwargs to use new delay kwarg
* Fix abc.GuildChannel.overwrites returning None keys.Rapptz2019-04-141-1/+8
| | | | | This has potential for data loss as a consequence of how the function works.
* simplify HistoryIterator message orderingkhazhyk2019-04-071-7/+5
| | | | | | | | | | | | | | | | | | | | rename reverse -> oldest_first, which is more obvious what it does. Then, honor it entirely - if you specify no `after` endpoint, we default to the beginning of message history, similar to how `before` defaults to the end of message history. This is a breaking change, and will change the behavior of any iterator that previously would have been returning messages in a weird order for limits over 100 `for msg in history(reversed=True, limit=300)` would return the newest 300 messages, in a messed up order (100..0, 200..100, 300..200). `for msg in history(oldest_first=True, limit=300)` will now return the oldest 300 messages in order. And so on. `for msg in history(after=msg)` is unchanged, this previously would return the oldest 100 messages after `msg`, oldest->newest order, and still will.
* Make abc.GuildChannel.overwrites return a dictionaryRapptz2019-04-061-7/+6
| | | | Fix #2016
* Add type checking to multi-file sendDice2019-03-201-0/+2
| | | | Convert list comprehension to genexpr
* Fix sending multiple filesDice2019-03-201-2/+1
| | | | Fixes #2002
* Expose MetadataNCPlayz2019-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added access to: * `/users/@me/guilds` * `/guilds/{guild_id}` * `/guilds/{guild_id}/members/{member_id}` BREAKING CHANGE: * `get_user_info` -> `fetch_user_info` to match naming scheme. Remove useless note Remove `reverse` and corresponding documentation Update documentation to reflect #1988 Rename `get_` HTTP functions to `fetch_` Breaking Changes: * `get_message` -> `fetch_message` * `get_invite` -> `fetch_invite` * `get_user_profile` -> `fetch_user_profile` * `get_webhook_info` -> `fetch_webhook` * `get_ban` -> `fetch_ban` Fix InviteConverter, update migrating.rst Rename get_message to fetch_message
* Organise documentationNCPlayz2019-03-191-35/+35
|
* Take back ownership of files from aiohttp for retrying requests.Rapptz2019-03-181-1/+1
| | | | Fix #1809
* Add support for store channels.Rapptz2019-03-171-2/+6
|
* Fix documentation linking issue in Messageables and ContextRapptz2019-03-161-26/+26
|
* 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
|