duck-dynasty / duckbot

A Discord bot for personal friend group
GNU General Public License v3.0
9 stars 10 forks source link

🐛 split solution into multiple embeds if they're big #963

Closed twentylemon closed 2 months ago

twentylemon commented 2 months ago
Summary

Part of https://github.com/duck-dynasty/duckbot/issues/959

Discord embeds can only have 25 "fields," and a field is used for every recipe in the solution. Splitting into many embeds overcomes that limitation. Example in beta.

But the command can still fail for HUGE factories. Discord still has a 6000 character limit, example.

Checklist
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 95.91%. Comparing base (a351ab6) to head (25de53c). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
duckbot/cogs/games/satisfy/pretty.py 62.50% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #963 +/- ## ========================================== - Coverage 95.99% 95.91% -0.09% ========================================== Files 92 92 Lines 2149 2152 +3 Branches 252 253 +1 ========================================== + Hits 2063 2064 +1 - Misses 65 67 +2 Partials 21 21 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

twentylemon commented 2 months ago

Sonar is complaining about, "Refactor this function to reduce its Cognitive Complexity from 24 to the 15 allowed." on solution_embed. There's a lot of ifs, but they're already pretty well spaced and laid out, imo.

twentylemon commented 2 months ago

Not sure what's going on with the sanity test case. The runner can't download the python docker image. Still ready for review, my guess is that it is a transient error.