ClemBot icon indicating copy to clipboard operation
ClemBot copied to clipboard

feat: Add latex rendering

Open brenapp opened this issue 3 years ago • 6 comments

Is your feature request related to a problem? Please describe. Having the ability to succinctly add equations can be incredibly useful for discussions, especially for more math-intensive courses.

Describe the solution you'd like Add a command to display tex equations.

Reference Implementation The simplest way to do this would be to rely on an online service like codecogs. I did this in my bot. The slightly better/more fancy version of this image would be to download the generated image, and then upload it so the URL doesn't display. https://github.com/MayorMonty/vexbot/blob/master/src/commands/latex.ts

Example invocation

image

brenapp avatar Apr 10 '21 02:04 brenapp

This is an amazing idea, what are the rate limits like for that site?

Jay-Madden avatar Apr 10 '21 03:04 Jay-Madden

I have not encountered any for mine, so as long as we are responsible, and enforce reasonable rate limits on our end, it isn't an issue.

brenapp avatar Apr 10 '21 03:04 brenapp

gotcha, ya seems to be relatively simple. Is this something you would like to add or are you just leaving the suggestion?

Jay-Madden avatar Apr 10 '21 03:04 Jay-Madden

If there is an api, it seems simple enough. Have you researched the subject? @MayorMonty

For @Jay-Madden's rate limit problem, we could add a call back function? That way the bot doesn't get stuck on one person's code.

zepthro avatar Apr 11 '21 17:04 zepthro

Rate limits won't hang the bot, it'll just be a different response. Due to how async works every command is a seperate thing so one call hanging or being rate limited wont effect the bot itself

Jay-Madden avatar Apr 11 '21 18:04 Jay-Madden

The service does not enforce rate limits, as far as I can tell. We should be respectful of it, and only allow the command to execute every few seconds (5 is probably more than reasonable), and we should be fine

brenapp avatar Apr 11 '21 19:04 brenapp