Class CommandContext

java.lang.Object
com.github.copilot.sdk.json.CommandContext

public class CommandContext extends Object
Context passed to a CommandHandler when a slash command is executed.
Since:
1.0.0
  • Constructor Details

    • CommandContext

      public CommandContext()
  • Method Details

    • getSessionId

      public String getSessionId()
      Gets the session ID where the command was invoked. @return the session ID
    • setSessionId

      public CommandContext setSessionId(String sessionId)
      Sets the session ID. @param sessionId the session ID @return this
    • getCommand

      public String getCommand()
      Gets the full command text (e.g., /deploy production).
      Returns:
      the full command text
    • setCommand

      public CommandContext setCommand(String command)
      Sets the full command text. @param command the command text @return this
    • getCommandName

      public String getCommandName()
      Gets the command name without the leading /.
      Returns:
      the command name
    • setCommandName

      public CommandContext setCommandName(String commandName)
      Sets the command name. @param commandName the command name @return this
    • getArgs

      public String getArgs()
      Gets the raw argument string after the command name.
      Returns:
      the argument string
    • setArgs

      public CommandContext setArgs(String args)
      Sets the argument string. @param args the argument string @return this