How to get user inputs from the teams command bot using typescript and teams toolkit

27 Views Asked by At

Here i mention the my handler code and json file.inside the handler context.activity.value undefine.i need to get user input from the bot.i use TeamsFxBotCommandHandler library for my handler.please give me support to fix this.

async handleCommandReceived(
    context: TurnContext,
    message: CommandMessage
  ): Promise<string | Partial<Activity> | void> {
   
    console.log("handleCommandReceived", context.activity.value);

    const cardData: RemainingLeaves = {
        annualLeaves: "2",
        medicalLeaves: "3",
        casualLeaves: "4"
    };
  
 
    const cardJson = AdaptiveCards.declare(requestLeavesCard).render(cardData);
    const d = MessageFactory.attachment(CardFactory.adaptiveCard(cardJson));;

    return d;
  }
{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.5",
    "body": [
        {
            "type": "TextBlock",
            "text": "Leave Request Form",
            "weight": "bolder",
            "size": "medium"
        },
       
        {
            "type": "Input.Text",
            "value": "Input.Text",
            "id": "comment",
            "label": "Comments",
            "placeholder": "Enter your comments here",
            "isMultiline": true
        }
        
    ],
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Submit",
            "data": {
                "action": "submitForm"
            }
        }
    ]
    
}

0

There are 0 best solutions below