TJ-Bot
TJ-Bot copied to clipboard
Bytecode command
Adds a code action that allows viewing the bytecode of Java code. The code has to compile for this to work.




Checklist
- [x] Compiler subproject
- [x] PoC
- [x] command as code action
- [ ] polish compiler subproject
- [ ] javadoc
- [ ] logging
- [ ] a unit test to at least trigger the runtime-based code flow
- [ ] UX enhancements for snippets and classes with other names
Not a slash command? Can you quickly elaborate why?
Can you also show a quick example picture of a dialog, so that we can see the resulting message?
Not a slash command? Can you quickly elaborate why?
Slashcommands do not yet support multiline messages. Therefore, we have to use "regular" commands for now since multiline support is basically required for code blocks.
Can you also show a quick example picture of a dialog, so that we can see the resulting message?
An example interaction: https://streamable.com/o2mpcw
Not a slash command? Can you quickly elaborate why?
Slashcommands do not yet support multiline messages. Therefore, we have to use "regular" commands for now since multiline support is basically required for code blocks.
Makes sense. What about the "message-id" feature you created for the tag system. I found that pretty cool. Maybe we just use that and then go slash command?
Not a slash command? Can you quickly elaborate why?
Slashcommands do not yet support multiline messages. Therefore, we have to use "regular" commands for now since multiline support is basically required for code blocks.
Makes sense. What about the "message-id" feature you created for the tag system. I found that pretty cool. Maybe we just use that and then go slash command?
Imo it'd be pretty annoying to have to do that every time and would also cause issues with the current auto-update editing-system. Once slashcommands support multilines we can use them though.
Can you give a rough overview of how the command works under the hood? I.e. a technical explanation? What tools does it use, what is the flow etc?
Btw, sonar fails. Looks minor though.
The checks fail. Please run spotless
There is 2 bugs that need to be fix other than that all good. I might fix them.
Should fix SonarCloud error
I might fix them.
@RealYusufIsmail Please do not just commit to branches of others. This is abuse of your permissions. Thank you for trying to help but the way you handled this was very disruptive and disturbing, causing merge conflicts and confusion on @illuminator3 side. For example, if he already had uncommited local changes, maybe he even already fixed the issues you mentioned locally.
If you want to contribute to the PR of someone else, here are the options:
- kindly ask them if you can do this together, wait for a response and then coordinate
- suggest changes to the PR via GitHubs code review UI, the author can then approve or dismiss them
- suggest changes to the branch the PR is based on via another PR (a "PR to a PR"), illu can then approve or dismiss them
- all of those require that the author approves and responds. in case the author is inactive, contact someone else (like me) for replanning the feature - i.e. unassigning the original author and assigning you, then it would be your PR
@illuminator3 I was thinking. What was the reason again that this is not a slash command? Just the fact that you can reply to a message for nicer/faster UX?
If that is the case, I actually vote for going a slash command instead, which takes the message id (similar to the tag commands). I know that the UX is then a little bit more cumbersome (right click > copy message id, instead of right click > reply) but I do see more value in having the extra visibility and discoverability that slash commands provide.
This command naturally wont be used often, hence I think it is important that people can easily "discover" it by browsing the available slash command list, instead of just remembering a "magic command" which is only used rarely.
No. It's terrible UX.
No. It's terrible UX.
I just hate that ur introducing the first and maybe also only command that is not a slashcommand 😬 Its so against the streamlined concept we created until now haha.
I can accept it but I dont like it, @marko-radosavljevic whats your opinion here?
we already have the /tag-manage which takes a message id
wouldnt that work perfectly for this and reusing code and it was even written by illum
No. Like I said already, it's terrible UX.
@Zabuzard
Yeah, it's also not something we often use, doing 2 clicks with mouse once in a while is not that terrible, to keep the consistency with literary every other command we have.
Introducing inconsistencies like this is also a bad UX, because we once again we have a problem we are currently trying to eliminate. Oh, is it ?command or !command or >command, how to use it… etc.
If we had more features that don't work well with slash commands, and it's something we need and frequently use, would make more sense imo, currently not so much.
So I guess I'm also in the camp 'I can accept it, but don't like it'. And since most of us agree on it, it's probably the approach we should take. ^^
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
bump
bump
Sorry, are you waiting for something? Iirc we wanted to have it changed to slashcommand and then it can be merged, I guess. CR of the code itself is pretty much through already.
The main feature of this command (editing already existing "command usages") requires it to be a non-slash command. Even if Discord would release multi-line slash commands, this feature would not be possible to implement.
this feature would not be possible to implement.
I dont quite follow. Whats the difference between
!bytecode <code>
and
!bytecode message-id:123456 where message 123456 contains <code>
other than pure UX? Functionality-wise it would work the same.
This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.
@illuminator3 are you fine with using message context-menus? Once our project finally updates.
@illuminator3 are you fine with using message context-menus? Once our project finally updates.
that's the preferred solution. I was originally going to use that but JDA didn't support it at the time of making this
mention me again (cuz I receive mobile push notifs) once we have support for context menus
Then we've to wait till JDA 5 released, will be a few months unfortunately. Unless we agree unto using the stable alpha builds.
This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.
This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.
@Tais993 any update on when we'll be getting context menus?
Waiting for #382, but currently too busy with internship. Will be finished in 3 weeks, so hopefully I've more free time then, alternatively someone else deals with it.
Only has to be merged really, #368 can be finished another time I guess








