practical-python-org / ZorakBot

The house bot of Practical Python
MIT License
17 stars 18 forks source link

[Minor] Refactor/runcode #421

Closed JefeThePug closed 5 months ago

JefeThePug commented 5 months ago

Made changes to improve the run code cog. Instead of trying to change input() in the users code into actual hard-coded values, I used the built-in way that PistonAPI handles stdin resulting in a much more flexible and less error prone solution. Now Zorak will be able to handle input() calls inside of loops whereas before this was not possible.

Also I refactored the get_embed() function to reduce the amount of repetitive code.

Finally this was all formatted with Black auto formatter.

ToDo? fix the name / docstring of "chop_dat_boi_up()" maybe? haha.

Xarlos89 commented 5 months ago

Screenshot 2024-05-04 at 10 43 59 AM Seems to be working well!