botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Adaptive Cards] Delete message from context?

Open CalvinFengDatacom opened this issue 8 years ago • 5 comments

Is there any way that I can remove/delete the posted messages from context? I can't find any function that can delete the message.

Expected Behavior Once user click the button of adaptive card, I would like to remove the adaptive card. So, if I can remove the message, so I can remove the adaptive card.

CalvinFengDatacom avatar Dec 17 '17 20:12 CalvinFengDatacom

@nwhitmont I would like to delete a message from context. Do you know how to delete a certain message I want? Adaptive Card is just an example, but if you have any idea of deleting a certain message, then I can use the same logic to delete adaptive card from the context

CalvinFengDatacom avatar Dec 19 '17 02:12 CalvinFengDatacom

Hi @CalvinFengDatacom

What do you mean by "delete message from context"? Are you using the WebChat channel, and want to remove a message in the chat window after the user interacts with the Adaptive Card? Removing messages is not a built in feature of WebChat. You would need to fork the open source repository, and add support for this. Here is the WebChat repo: https://github.com/Microsoft/BotFramework-WebChat

Let me know if you have any questions.

EricDahlvang avatar Dec 20 '17 21:12 EricDahlvang

Thanks @EricDahlvang

Your are right, I'm using WebChat channel for developing the bot ATM. I would like to remove a message in the chat window after user interacts with the adaptive card. This is my question, and I think you already give me the answer.

I will have a look the repository when I'm free.

CalvinFengDatacom avatar Dec 20 '17 22:12 CalvinFengDatacom

So, any progress on this? I'd like to know how @CalvinFengDatacom managed to fix this issue.

artus avatar Aug 07 '18 11:08 artus

@artus Unfortunately I don't think we can do it from out-of-box. So, what we just did is set a mark for each of the adaptive card, when the adaptive card has been submitted, it will be marked by using the state data. So, if user want to submit the same adaptive card again, then it will notice user that they have already submitted, you can do ABC or XYZ to redo your business logic/flow again.

CalvinFengDatacom avatar Aug 08 '18 01:08 CalvinFengDatacom