Package com.github.copilot.sdk.json
Class CommandContext
java.lang.Object
com.github.copilot.sdk.json.CommandContext
Context passed to a
CommandHandler when a slash command is executed.- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetArgs()Gets the raw argument string after the command name.Gets the full command text (e.g.,/deploy production).Gets the command name without the leading/.Gets the session ID where the command was invoked.Sets the argument string.setCommand(String command) Sets the full command text.setCommandName(String commandName) Sets the command name.setSessionId(String sessionId) Sets the session ID.
-
Constructor Details
-
CommandContext
public CommandContext()
-
-
Method Details
-
getSessionId
Gets the session ID where the command was invoked. @return the session ID -
setSessionId
Sets the session ID. @param sessionId the session ID @return this -
getCommand
Gets the full command text (e.g.,/deploy production).- Returns:
- the full command text
-
setCommand
Sets the full command text. @param command the command text @return this -
getCommandName
Gets the command name without the leading/.- Returns:
- the command name
-
setCommandName
Sets the command name. @param commandName the command name @return this -
getArgs
Gets the raw argument string after the command name.- Returns:
- the argument string
-
setArgs
Sets the argument string. @param args the argument string @return this
-