ADD mobile-friendly Discord ide/status reports via Pillow image generation #327
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ADD images for discord reports commands on mobile
Note: I was unable to set up the DB on my local machine while testing this due to a truly byzantine web of issues; as such, I had to test with mock data. This PR should be tested with a working DB before it is merged into the main branch, if ever.
On mobile devices with smaller screen sizes, the !report and !ide Discord commands are very difficult to read. As such, this PR creates mobile-friendly versions of those commands by turning the text into an image with Pillow and sending that.
To avoid creating any temporary files, this PR sends a BytesIO object to discord.File, which can accept either a filename or binary data.
Currently, the formatting of the mobile-friendly images is very barebones; there is considerable room for prettifying these images, as there is with the rest of the commands and embeds.
Finally, in the event of explosive growth in Anubis usage, these commands will have to be refactored to support displaying even more IDEs and courses; for instance, adaptive image concatenation in !ide instead of concatenating at most two images together.