engineer-man / piston-bot

I Run Code bot on Discord
https://emkc.org/run
MIT License
244 stars 36 forks source link

Use slash commands instead #48

Closed dannyhpy closed 2 years ago

dannyhpy commented 3 years ago

As stated here support-dev.discord.com/hc/en-us/articles/4404772028055. Discord will put Message Contents behind a privileged intent

Slash commands interactions are not affected by this change

It needs to be verified but as far as I am aware, newlines are not supported in slash commands so it might be problematic?

realtux commented 3 years ago

i'm going to apply for this new intent and if they deny it then we'll look into slash commands. right now, people know how to interact with this bot with / which was done before slash commands was a thing. i just assume leave it as is unless discord is going to force us to change by denying the new intent to us, which i seriously doubt they will anyway.

nevertheless, thanks for mentioning this. i now need to apply for that intent.

TheShubhendra commented 3 years ago

There is no issue in adding slash commands right now, as previous traditional in message Commands will also be there, and people will gradually start to get the taste of Slash commands too. Since slash command will be the only way to interact with the bot. So if you want I can work on slash command implementation.

dannyhpy commented 3 years ago

You could start working on slash commands but it's worth mentioning that


Also, the bot will still be able to get message content when it is mentionned. So, the following syntax will still work after April 2022.

  @[I Run Code] run nim ```nim
    echo "Hello world!"```

Thus, the privileged intent is actually not mandatory.

realtux commented 3 years ago

much has changed in the last few months. slash commands is not something we're ever going to support, but for different reasons than above.

the first issue is discord.py doesn't support it and discord.py is no longer maintained.

the second issue is myself and a few other team members did some due diligence to determine if it were even practical to use slash commands. our conclusion was it was not.

slash commands doesn't support code blocks, it would brick editing, and it doesn't show the input which resulted in some output.

realtux commented 2 years ago

just an update on this, i run code was approved for message intent and slash commands were deemed impractical to implement, so until discord updates slash commands to support the full range of things i run code needs, or even the core stuff, it won't be happening.