String compression for custom ids #14
Labels
enhancement
New feature or request
priority: low
target: rewrite
This will be completed in the rewrite.
Summary
Add string compression for custom ids, such that users can store more data than normally allowed by discord's 100-character limit.
What is the feature request for?
disnake.ext.components
The Problem
Discord enforces a maximum length of 100 characters for their components' custom ids. Since ext-components stores data in these custom ids, it is feasible to run out of space. It would be nice to provide the user with hooks with which they can (de)compress custom ids with a compression lib of their choice.
The Ideal Solution
Provide users with hooks to (de)compress custom ids. Provide a 'default' library through installation of e.g.
disnake-ext-components[compress]
. This default library will probably be python bindings tounishox-2
:unishox2-py3
, as this can handle the complex nature of custom ids an d still provide compression.note: discord only cares about text-length, not byte length, which we can make optimal use of with this lib.
The Current Solution
Currently, the only way to make use of compression would be to use a custom converter on each callback parameter to individually compress them. In many situations, this would barely provide any gains.
Additional Context
This should come paired with proper length checks for created custom ids.
The text was updated successfully, but these errors were encountered: