python-discord/meta

Add code execution via context menu

Anonymous4045 opened this issue · 1 comments

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.

jb3 commented

I don't think this issue is going to see a lot more traffic here given it's more than a year old, however, I'll re-open the issue on bot and if we want to take discussion further we can host it there, it will have more visibility than in this repository.

Relevant bot issue: python-discord/bot#2270