Class ChatbotService

java.lang.Object
com.csse3200.game.components.mainmenu.ChatbotService

public class ChatbotService extends Object
ChatbotService handles predefined responses for the chatbot. It processes user input and returns appropriate responses based on predefined keywords.
  • Constructor Details

    • ChatbotService

      public ChatbotService()
      Constructor for ChatbotService. Initializes the predefined responses that the chatbot can reply with.
  • Method Details

    • getResponse

      public String getResponse(String userMessage)
      Processes the user's input and returns a response based on predefined keywords. If a keyword is found in the user's message, the corresponding response is returned. If no keywords match, a default response is provided.
      Parameters:
      userMessage - The message entered by the user.
      Returns:
      The chatbot's response based on predefined keywords, or a default response if no match is found.