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

ADD mobile-friendly Discord ide/status reports via Pillow image generation #327

Merged
merged 5 commits into from
Dec 24, 2021

Conversation

LevBernstein
Copy link
Contributor

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.

@LevBernstein LevBernstein marked this pull request as ready for review December 22, 2021 02:08
@wabscale wabscale merged commit 58ed6ca into AnubisLMS:master Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants