-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support user app installation context #80
base: master
Are you sure you want to change the base?
Conversation
I do appreciate the work you did here. Before I decide to dive into this any more we have to clarify some things with input from @realtux Modals:As I have always understood it, this bots primary purpose was always "visual teaching" - meaning it is supposed to be used on a server by someone who wants to show something to someone else. (or similar) For that it's arguably necessary for everyone to see the input easily. We looked at modals when they came out but back then seeing the input code was not very visually friendly. Has this changed? I assume you still need an extra click and if the source code is verbose, it's still hard to parse. Right click menu activationWhen activating something with the right click menu, the input and output might become separated in the chat which would be harder to parse for viewers. User appI'm not sure if Piston/The Bot are meant as "personal code runner" for anyone. User apps are kind of meant to be used by a user alone are they not? Resource usageI am not certain how this will impact the bot's resource usage and as far as I know, the current resource usage is "too much" already. Again thank you for your work. Lets figure out how to proceed. |
thinking strictly about user experience, this is probably an upgrade, and it's pretty neat work. however, thinking about the purpose of piston-bot to begin with, as brtwrst pointed out, it's probably a downgrade for having an additional click to see the source code. additionally, it would appear edit would no longer be a thing. you might not be aware but the bot will re-evaluate the code on a message edit. this is a quite useful feature. |
Edit will still exist for current commands but not for these, no. I can't think of a good solution for these ones |
will /del work when using the modals? |
Del doesnt work because i forgot it existed but users can delete the message yes |
Well I'm not opposed to this. Hopefully shouldn't break any existing functionality. |
The max (and default) is 4000 but we can set it to whatever we want under that, that is a one way to limit the output length |
You could just send the source code as a text attachment if it is too long for a message. |
OK so why does the commit "Support user app installation context" also
The meat of "supporting user app installation content" as i see it is
The rest just makes it hard to parse. Can you split this big commit and move the other refactoring stuff into it's own commit? Also how will |
I guess I can revert the type stuff |
Okay I have reverted all formatting changes and all of the types except for the user commands as those require them |
Ok the only thing remaining is to prevent it from crashing if a file is uploaded / run that has more than ~2000 characters. |
- doesnt work?
- Incase request takes longer
- mainly defer stuff
Hello!
I added the ability to use it as an user installable app! closes #79
Some other minor changes such as annotating functions
If you find issues, then let me know of course.
showcase.mp4
For this pr to be functional you have to toggle the installation context at https://discord.dev/
And a nit from me, I suggest that there should be a .vscode/settings.json file (for whatever reason its in .gitignore currently?) since having the code formatting settings in the editor would enforce them more.
Thats why you might notice some random changes because I originally used ruff instead of autopep8. I recommend getting a linter/formatter such as ruff, since there is a lot of weird styling (like mix-matching different quotes, some code is formatted/intended differently to other)