Releases: AlexFlipnote/discord.http
Version 3.1.2
This update mostly just improves the general documentation, enjoy more readable docs!
Full Changelog: 3.1.0...3.1.2
Version 3.1.0
Overall, this was going to be 3.0.4, but there was so many drastic changes internally that it deserved its own number.
- Added support for
Client.api_base_url, if you wish to change to a proxy API. - Added
Context.send_modal()if you first send an empty response. - Added
User.is_default_avatar()andMember.is_default_avatar()to check easier if they are using default avatar - Added
sys.internon to common strings to reduce memory footprint - Added more logging.debug to make it easier to figure out why your code is bad.
- Added names to all
asyncio.Taskcreated by discord.http - Improved the internal utilities for greater efficiency
- Improved
Embedto have more class structure to make editing it easier - Made the ratelimit more robust with actual pattern checking for shared ratelimits.
- Moved cache handling of
Guildfrom theParserto the actualGuildto improve speed - Implemented
asyncio.Lockfor ratelimit handler, making sure you do not need to useasyncio.Queue, the lib handles the queue for you. - Introduced a better way to handle ratelimits, and clear cached ratelimits .
- Implemented better handling of
asyncio.Taskhandling in the background, for example call_after, after_invoke, etc. - Improved HTTP multipart handling to remove the risk of memory leaks.
- Fixed
File.savenot chunking when saving to reduce memory footprint. - Reduced multiple function handlings, making it more CPU/RAM efficient while producing the same result.
- Improved types around the codebase to make more sense.
- Implemented value checking for
View()to make life easier to debug, when your view is not being sent (aka. you get raise'd). - Improved discord.http/gateway shard handling to both run smoother and reduce memory footprint.
- Improved docs to classes and functions to be easier to understand
- Removed the need to use
sync=TrueforClient()as it now defaults to True, making life easier. - Removed the need to provide
application_idandpublic_key, since the library will find it for you with thetokenprovided.
This update is so efficient, I am able to run one bot that has 190,000 guilds, ~5,000 user installs, no gateway, ~50 commands at a staggering low memory usage of ~60 MB 🎉

Full Changelog: 3.0.3...3.1.0
Version 3.0.3
Overall, this change only introduces a more robust and better ratelimit handler. The only reason I even did this to begin with, was because I noticed that GET /channels/:ID/messages was just ratelimiting me many times without being properly handled by the library. I first tried to improve the ratelimit code many times, until I noticed that Discord just straight up sends wrong headers to the bot.


So.. to not waste the time I spent, I am releasing an updated version of ratelimiter that overall is much better at least, which also fixes the bug where if a query is being used (example: GET /channels/:ID/messages?limit=100&after_id=1337) it would not work properly.
In short:
- Ratelimit handler internally is now more robust and cleaner code
- More details about ratelimit provided in debug logs
- Thanks Discord for making me re-visit the ratelimit code ❤️
Version 3.0.2
- Improve file saving method to be truly async
- Made sure to not use default AllowedMentions when editing a message
- Improved checkbox implementation to not just error out
Full Changelog: 3.0.1...3.0.2
Version 3.0.1
What's Changed
- Implement components phase 4 by @AlexFlipnote in #26
- Added
Context.defer()to be able to defer anempty_response - Add internal benckmark to
Contextso you can debug 3s rule easier withContext.benchmark - Added more internal cache values for parsing and such to improve overall speed when executing and parsing things for you (low cache impact, at best maybe a few KBs like.. 1-10?)
- Added support for more components (Phase 4) that are coming soon
- Implemented new API args for when you create an invite
- Changed how
Client.useris stored and also implementedClient.application - Improved
discord_http.gateway.shardto have more cache and less bloat, making the speed better - Fixed so
orjsonis used in more places to improve JSON rendering speed - Improved example codes to make it more accurate
- Improved library tools to make life easier for developers, such as
utils.URL - Improve docs on every function possible (hopefully I covered everything
- Removed
application_idandpublic_keyfromClient, the lib finds it for you with just yourtoken
You can get this update from pip install discord.http, enjoy!
Full Changelog: 3.0.0...3.0.1
Version 3.0.0
What's Changed
- Implement file support for modal by @AlexFlipnote in #23
- Update error message for SectionComponent validation by @Neppkun in #24
- Quart -> aiohttp by @AlexFlipnote in #25
- Change wording in discord_http.User for User.display_name_styles to make more sense
- Added more docstrings around classes and functions to improve documentation
- Fixed create soundboard for guild function not working properly
- Removed two dependencies: yarl and Quart
- Added fallback method for Asset where you can show missing texture bytes instead
- Added more debug logging to improve debugging
- Added more utils for common tasks done both by developers and maintainer
- Fixed type errors and parsing errors due to None values
- Added missing API endpoints
New Contributors
Why removing dependencies
Because I wish to keep the project minimal, only have the bare minimum to run it and no bloat. If there is a little to no reason to have something around, you bet it will be removed instantly. Yarl was just wasteful where I only used it for very simple tasks, so I replaced it with a self-made class that takes advantage of Python's built-in libraries while keeping somewhat the same syntax as yarl.
Quart's removal was because I was already using aiohttp for HTTP requests out and WebSocket service, so I might as well take advantage of the fact that it also provides a way of serving a web server to get the POST requests from Discord API, while also being a faster alternative to the previous web server the library was using. For people who were using the backend code method, you will have to change your code to adapt, otherwise if you did not use a custom backend, you can skip this part and continue hosting your bot as per usual.
Full Changelog: 2.4.1...3.0.0
Version 2.4.1
What's Changed
- Feat: TextDisplayComponent and Mentionable selects support by @AlexFlipnote in #21
- Display name styles by @AlexFlipnote in #22
What's new
- Added
enums.DisplayNameEffectType - Added
enums.DisplayNameFontType - Added new
User.display_name_stylesthat returnsDisplayNameStyle - Added missin enums in places
- Added support for role/mentionable selection on modals
Full Changelog: 2.4.0...2.4.1
Version 2.4.0
This is a breaking change due to behaviour change of modals in discord_http.View
- Fixed icon and banner for guild during
guild_updateevent not updating - Fixed type hints on various places
- Removed duplicate docs for arguments, parameters and attributes
- Improved docs quality by adding more attribute docs
- Filled missing flags for Permissions
- Improved error for when you do not return a response with interactions
- Added support for modal string select (phase 1 of modal update, breaking change)
How does the breaking change work?
In modals, you basically have to spesify what kind of item you are adding. Before, it was simply this example:
from discord_http import Modal
modal = Modal(title="Hello world")
modal.add_item(label="Test")However now, to do the same thing, you will have to do the following:
from discord_http import Modal, TextInputComponent
modal = Modal(title="Hello world")
modal.add_item(TextInputComponent(
label="Test"
))This addition is to make sure that if they plan to add more things in later time, it will be dynamic and easy to update it without causing yet another breaking change. You can honestly just slap TextInputComponent on all current modal.add_item() if anything, it might work, but it will remain labeled as a breaking change since it breaks current structure too much.
Version 2.3.1
- Add docs for MessageReaction (oops)
- Add more functions (like fetching who reacted) and easier use for MessageReaction
Version 2.3.0
- Added better support for
User/Member.avatar_decorationandUser/Member.nameplate - Added
User/Member.primary_guild(aka. clan) - Improved docs on classes to show attributes as well for website
- Improved "Getting Started" to be both more accurate and more explaining
- Added ability to customise interaction url path (Default is
/aka. root of the URL) - Fixed command description not removing whitespace due to docstring
- Breaking changes for User/Member, which is the reason for version bump
- Collectible is removed
- Avatar decoration is rebranded to be more full
- Avatar decoration data is removed
- Removed clan in favour of primary_guild as name instead