Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
189 views
in Technique[技术] by (71.8m points)

c# - Restarting conversation state for testing proactive messages

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...