aboutsummaryrefslogtreecommitdiff
path: root/discord/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Minor documentation fixesRapptz2020-01-211-2/+2
|
* Add missing coroutine header for sleep_untilRapptz2020-01-211-1/+3
|
* Improve usability of utils.sleep_untilJosh B2020-01-211-2/+8
| | | | | | | | | Fix issue where sleeping for an extended period on python 3.5 would cause an exception Add sleep_until to API docs Add result argument to sleep_until
* Drop superfluous zero in version related changes in the documentationRapptz2020-01-211-2/+2
|
* Add discord.utils.sleep_until helper functionJosh B2020-01-211-0/+18
|
* Bump copyright year to 2020Rapptz2020-01-191-1/+1
| | | | Closes #2510
* Be more explicit in the utils.find example code.alexandrianlibrarian2019-12-171-1/+1
|
* Fix more deprecation warningsRapptz2019-11-201-1/+4
|
* Fix all deprecation warnings for 3.8Rapptz2019-11-201-2/+2
|
* Update regex to fetch URLs to match the official client.Rapptz2019-11-181-1/+1
| | | | Fixes #2420.
* Use X-Ratelimit-Reset-After header by default.Rapptz2019-08-271-4/+9
| | | | There is now an option to turn it off, of course.
* Use new rate limit millisecond precision option.Rapptz2019-08-271-1/+1
|
* Escape quote markdown in utils.escape_markdownRapptz2019-07-271-1/+1
|
* Add Guild.query_members to fetch members from the gateway.Rapptz2019-07-151-1/+3
|
* Improve documentationNCPlayz2019-06-071-14/+11
|
* Speed-up utils.get for the common casesRapptz2019-05-291-11/+21
|
* add read-only cached_messages property to Clientkhazhyk2019-04-171-0/+27
| | | | For those of us who want access to this sweet trove of zero hop messages
* Forgot to escape backticks.Rapptz2019-04-071-1/+1
|
* Add ignore_links and as_needed options to utils.escape_markdown.Rapptz2019-04-071-5/+30
| | | | | | This allows for URLs to be left alone since they can include markdown characters and allows for total escaping of all markdown characters by default to prevent some form of data manipulation.
* Fix regex substitution in utils.escape_mentionsRapptz2019-04-061-1/+1
|
* Add helpers to escape markdown and mentions from text.Rapptz2019-04-061-0/+40
| | | | Fixes #1673
* Add support for guild widgetNCPlayz2019-03-191-0/+26
|
* Organise documentationNCPlayz2019-03-191-6/+6
|
* Add support for guild bannersSnowyLuma2019-03-091-2/+2
| | | | | | | | Document banner attribute of Guild and Invite Update discord/utils.py Co-Authored-By: SnowyLuma <[email protected]>
* Better jpeg detection in utils._get_mime_type_for_imageRapptz2019-02-231-1/+1
| | | | Fixes #1901
* Fix missing import.Rapptz2019-02-061-2/+2
|
* Try to optimize for the common ASCII case.Rapptz2019-02-061-3/+10
| | | | | This is still a slowdown (about 45ns to 300ns) but it's less severe than the original implementation (about 900 to 1100ns).
* [commands] Fix ext.commands help page full-width indentationcod2019-02-061-0/+9
| | | | | add _string_width function to util. Changed string width calculate function from len() to util function _string_width().
* Bumped copyright years to 2019.Dante Dam2019-01-281-1/+1
|
* Use a tuple for startswith in mime detection code.Valentin2019-01-281-1/+1
|
* Support webp in _get_mime_type_for_imagekhazhyk2018-11-241-0/+2
| | | untested
* [lint] Fix import orderHornwitser2018-11-241-8/+9
| | | | | Reorder imports to be consistenly grouped by standard library, third party library, and local modules in that order thoughout the library.
* [lint] Simplyfy util.valid_icon_sizeHornwitser2018-11-241-1/+1
| | | | Remove redundant paranthesis and checks from util.valid_icon_size.
* [lint] Remove redundant paranthesisHornwitser2018-11-241-1/+1
| | | | | Remove redundant parenthisis around await expressions. Left over from f25091ef.
* Add Guild.splash_url_asMatt (IPv4)2018-10-111-2/+2
|
* Change internal representation of roles in Member and Emoji.Rapptz2018-09-241-1/+33
| | | | | | | | | | | | | | | 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 docstrings to raw-stringsBeatButton2018-09-141-1/+1
|
* [lint] Remove unused variablesHornwitser2018-08-221-1/+1
| | | | Left over from various refactoring and rewrites.
* Drop support for Python 3.4 and make minimum version 3.5.2.Rapptz2018-06-101-11/+8
|
* Fix TypeError in utils.oauth_urlReinaSakuraba2017-10-041-1/+1
|
* Change how coroutines are detected internally.Rapptz2017-09-161-3/+4
|
* Fix utils.get example.Rapptz2017-08-301-1/+1
|
* Add webhook support.Rapptz2017-08-211-0/+6
| | | | | | | Allows for usage of either `requests` and `aiohttp` when used in "Standalone" mode. Fixes #704
* allow trailing null bytes in uploaded jpegskhazhyk2017-07-251-1/+1
|
* avatar_url_as improvementskhazhyk2017-07-251-0/+4
| | | | | | | | | | | | | | | | | | | static_format will only apply to static (not animated) avatars. Makes it easier to grab gif-or-'format' of an avatar. Defaults to 'webp' This is for a similar usecase to avatar_url_as(format=None), except one can specify the non-animated format, instead of always using webp. add User.avatar_is_animated property. add validation for avatar_url_as, since invalid arguments result in a url which will return 415, which can be confusing for a user. (They just see a blank page) Discord accepts size=16-2048, but images cap at 1024px, so accept 16-1024 Discord accepts "jpg", "jpeg", "png", "gif", and "webp", *unless* the avatar is not animated, in which case "gif" is not supported. :\
* Implement "partial" message events.Rapptz2017-06-091-3/+1
| | | | | These are events that get triggered regardless of the state of the message cache. Useful for getting data from before the bot was booted.
* Use Python3Lexer instead of PythonLexer for pygments.Rapptz2017-05-221-3/+3
|
* Remove unused imports.Rapptz2017-04-181-1/+1
|
* Wrap asyncio.wait into a saner alternative that raises TimeoutError.Rapptz2017-02-251-0/+7
| | | | Fixes #494
* Allow utils.maybe_coroutine to take any arguments.Rapptz2017-02-131-3/+3
|