I've implemented proactive messages into my bot, however I'm very unsatisfied with the testing I've been able to do with this feature, since none of the tests I can think of actually "prove" I received a message proactively.
Basically, I want to send a message to members on Teams as soon as they install the bot, not as soon as they interact with it as is the traditional way. This is so when a member is added to an organisation, they are introduced to the bot without any user interaction.
To do this, I overrode OnTeamsMembersAddedAsync, and used that event to fire off a welcome message. When it comes to testing however, I can never be sure the welcome message fired because I opened the chat window, or because I installed the app.
For this reason, I cannot test it in the emulator, as that takes you straight to the chat which defeats the point. And I'm limited to 1 test per user account in Teams, because after you install the bot once, your conversation state is cached so it's never truly a fair test after the first interaction.
So my question is, is there any code that can clear my conversation, and re-add me so as to trigger OnTeamsMembersAddedAsync as if I'm a new user being added to the org? Or is there a better way of testing I haven't thought of?
question from:
https://stackoverflow.com/questions/65917109/restarting-conversation-state-for-testing-proactive-messages 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…