python-discord / meta

Issue tracker for suggestions and other questions relating to our community
https://pythondiscord.com
31 stars 5 forks source link

Add code execution via context menu #223

Open Anonymous4045 opened 11 months ago

Anonymous4045 commented 11 months ago

What feature are you proposing?

This has been suggested in the past here by @Robin5605, but was closed. The idea is to add the eval command to the Apps context menu on all messages, in the same way as the Bookmark app.

What is your justification for the proposed feature?

Very often, someone will ask "What's wrong with this code?" or similar and paste the code without an error. It can be hard to tell what's wrong without an error, and posting a full traceback takes up lots of channel space, especially for people who are on smaller devices. Sometimes people on mobile also just want to see if their code runs. And for people on mobile without access to a local interpreter, the only way to run the code is via the eval command. This still is somewhat awkward to do however, since the message needs to be copied, then pasted into the !e command.

It'd be much simpler to simply press a button that runs the code in the proper channel and pings the person who used it in the #bot-commands channel. @wookie184 noted in the issue raised by Robin that oftentimes the code is after a message, but it seems very feasible to be able to parse out the message for ```py and just run that part.