-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
1158: AWS version of JShell #1161
Conversation
dfe03d0
to
24c59b9
Compare
f3cf468
to
0d7d787
Compare
if (input == null || input.getAsString().isEmpty()) { | ||
EmbedBuilder eb = new EmbedBuilder(); | ||
eb.setDescription(member.getAsMention() | ||
+ ", you forgot to provide the code for JShell to evaluate or it was too short!\nTry running the command again and make sure to select the code option"); | ||
eb.setColor(Color.ORANGE); | ||
event.replyEmbeds(eb.build()).queue(); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when setting up code as command option, you can set required property to True thus user can't execute the command without passing in something as code to begin with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check, but I think true is the default value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it anyway, it enforces readability ig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
application/src/main/java/org/togetherjava/tjbot/features/jshell/aws/JShellAWSCommand.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/jshell/aws/JShellAWSCommand.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/jshell/aws/JShellService.java
Outdated
Show resolved
Hide resolved
0d7d787
to
86fc982
Compare
27ecb74
to
b18ac90
Compare
Description
This PR introduces a new slash command
/jshell-aws
and it's accompanying infrastructure.There are 2 parts:
Slash Command
The new
/jshell-aws
works by accepting 1 parametercode
which is a snippet of Java code the user provides to be evaluated.This command calls the API hosted on AWS and returns the result. At the moment, it's basic and does not compare to the existing
/jshell
command which has had much more thought put into handling user inputs and outputs.JShell AWS API
A new module has been added to the project called
jshell-aws-backend
. This is the complete infrastructure and code for performing the JShell logic in a serverless AWS Lambda and contains the IaC as a CloudFormation template.There is a GitHub action included in the PR which makes deployment a breeze.
#1158
Screenshots
Command
Error messages
Normal code execution