Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement(astral): Smart chunking of embed field data #75

Open
JacobCoffee opened this issue Mar 3, 2024 · 0 comments
Open

Enhancement(astral): Smart chunking of embed field data #75

JacobCoffee opened this issue Mar 3, 2024 · 0 comments
Labels
byte 🤖 Related to the Byte bot service enhancement ➕ This is a brand new feature or request good intermediate issue 🥇 Good for people that like a challenge help wanted 🆘 Extra attention is needed

Comments

@JacobCoffee
Copy link
Owner

JacobCoffee commented Mar 3, 2024

Summary

Embed fields are limited to <1024 characters, so we introduced chunking logic.

for idx, chunk in enumerate(chunk_sequence(formatted_rule_details["explanation"], 1000)):
embed.add_field(name="" if idx else "Explanation", value="".join(chunk), inline=False)

For the most part this does just fine, but it leads to ugly lines in embeds occasionally - and more importantly it can break markdown links provided by the ruff output

image

Basic Example

Make the chunking "smarter" to not break lines at awkward places

Drawbacks and Impact

No response

Unresolved questions

  • how

Note

We utilize Polar.sh to engage in regular as well as pledge-based > sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@JacobCoffee JacobCoffee added enhancement ➕ This is a brand new feature or request help wanted 🆘 Extra attention is needed byte 🤖 Related to the Byte bot service good intermediate issue 🥇 Good for people that like a challenge labels Mar 3, 2024
@JacobCoffee JacobCoffee changed the title Enhancement(astral): Enhancement(astral): Smart chunking of embed field data Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
byte 🤖 Related to the Byte bot service enhancement ➕ This is a brand new feature or request good intermediate issue 🥇 Good for people that like a challenge help wanted 🆘 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant