manimcommunity / discordmanimator Goto Github PK
View Code? Open in Web Editor NEWA Manim Rendering Bot for Discord. Requires a Functioning Manim install.
License: MIT License
A Manim Rendering Bot for Discord. Requires a Functioning Manim install.
License: MIT License
Would be possible with this script.
import re
from textwrap import indent
inputstring= """
class EllipseExample(Scene):
def construct(self):
ellipse_1 = Ellipse(width=2.0, height=4.0, color=BLUE_B)
self.add(ellipse_1)
"""
inputstring= indent(inputstring, ' ')
template="""
\"""
Examples
--------
.. manim:: CLASSNAMEHERE
:save_last_frame:
CODEHERE
\"""
"""
outputstring=template.replace("CODEHERE", inputstring)
#possible_scene_names = ["Scene", "GraphScene"]
first_word = "class "
scene_name = "Scene" # does not support e.g. GraphScene yet. Maybe with a for loop ?
classname=re.search(fr'{first_word}(.*?).({scene_name})', inputstring).group(1)
outputstring= outputstring.replace("CLASSNAMEHERE", classname)
print(outputstring)
"""
outputstring=template.replace("CODEHERE", inputstring)
first_word = "class "
scene_name = "Scene" # does not support e.g. GraphScene yet. Maybe with a for loop ? #possible_scene_names = ["Scene", "GraphScene"]
classname=re.search(fr'{first_word}(.*?).({scene_name})', inputstring).group(1)
outputstring= outputstring.replace("CLASSNAMEHERE", classname)
print(outputstring)
I'm not sure if this command is staying after the hackathon, but if it is having black
be applied would make code look a lot cleaner.
It would be nice if the bot can detect when the code in a previous manimate command was changed, and have it delete the old rendering and rerender the animation.
Making !mhelp
more descriptive by adding info about !mdocstring
, !mdoc
, !msearch
would be nice, as beginners can know how to use DiscordManimator
bot efficiently in discord.
Currently, !mhelp
is returning info only about !manimate
. It is much better if we include info about !mdocstring
, !mdoc
, !msearch
as well.
you could use glitch.com to host the discord bot
It would be nice if you could specify the manim version you want !mdoc for for users troubleshooting a problem on old versions. Something like !mdoc 0.4.0 LaggedStart
Currently the bot resets the cli flags when pressing the rerender button and automagically rerender when pressing the change settings button which makes it pretty difficult to test scenes which actually use command line flags because you have to retype them everytime you want to render something.
It seems as if long (>30 sec?) render queries block the heartbeat of the bot; the communication with docker should be made asynchronous if possible. (There is https://aiodocker.readthedocs.io/en/latest/index.html which could be a suitable replacement for the docker package.)
Originally posted by @behackl in #38 (comment)
If you msearch
2 or more queries quickly, and react with an emote to one of them, the other results will also be affected. This should definitely not be the case, reactions on a message should affect that message only.
Currently, the bot does not send anything if attempting to manimate something results in a traceback that is too long.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.