bot
bot copied to clipboard
`!eval` breaks when using stdin
when trying to use stdin with the eval command, the bot breaks and gives an arbitrary response:
maybe there's some way to redirect a discord message to stdin when prompted?
if not, the bot should at least give some sort of nicer error when trying to use stdin rather than the EOFError
We could check if EOFError is in the result (as well as maybe checking that "input" is on their code and the status code indicated an error), and if so add a message after the codeblock saying that input doesn't work with the bot.
Making input work would be more difficult, it would require changes to snekbox (the service used to run the code), and it's also not obvious how passing the input in discord would work.
perhaps this could be brought up on the snekbox repo then?
We'd probably only implement taking stdin in snekbox if we wanted to have it for the bot, and I'm not convinced it's worth the effort given it's usually pretty simple to just replace the input with a fixed string.
I think that's a separate issue that could be opened on this repo though. Even if we did support input users would get an EOFError if they forgot to supply it, so improving that response would make sense anyway.
Hello, not sure if should ask in this issue or in #2420. I'd like to work on improving the error message. If I understood things right the plan is to just improve the error message and not integrate the possibilty of using input().
I'd like to work on improving the error message. If I understood things right the plan is to just improve the error message and not integrate the possibilty of using input().
Well I thought to implement the issue myself after it got approved but now will try to find something else.
Oh, sure sorry. I didn't want to take it away from you.
Given #2422 I think it's fine to mark this as complete. This can be re-opened/a new issue opened if there's a concrete suggestion that would intuitively allow using input, but now there's a note in the output indicating what the error means.