python-discord / bot

The community bot for the Python Discord community
https://pythondiscord.com
MIT License
1.37k stars 674 forks source link

Have `!eval` be able to execute code from a replied message #2246

Open AbooMinister25 opened 2 years ago

AbooMinister25 commented 2 years ago

Summary

This proposes an enhancement to the existing !eval command that will allow !eval to evaluate code from a replied message.

The functionality could be implemented similar to commands like .uwu in lancebot. The command itself would use any given text, and if nothing was provided, use the text from a replied message.

TizzySaurus commented 2 years ago

I +1 this idea.

There's often times that I write out code, and then find myself copy-pasting it so that I can run it on !e because I forgot to do that in the original message.

Thanks to python-discord/bot-core#101 it'll be pretty easy to implement too should this be approved.

TizzySaurus commented 2 years ago

Note that @AbooMinister25 has said on Discord that they'd like to implement this themselves, so if approved they should be assigned.