1
봇/웹 페이지에 backchannel을 설정하려고합니다. 둘 사이에서 이벤트를 보낼 수 있습니다. 나는 Bot framework get the ServiceUrl of embedded chat control pageBackChannel 통신을위한 ActivityTypes.Event가 없습니다.
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
if (activity.Type == ActivityTypes.Event &&
string.Equals(activity.Name, "buttonClicked", StringComparison.InvariantCultureIgnoreCase))
{
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
// return our reply to the user
Activity reply = activity.CreateReply("I see that you just pushed that button");
await connector.Conversations.ReplyToActivityAsync(reply);
}
if (activity.Type == ActivityTypes.Message)
{
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
// return our reply to the user
var reply = activity.CreateReply();
reply.Type = ActivityTypes.Event;
reply.Name = "changeBackground";
reply.Value = activity.Text;
await connector.Conversations.ReplyToActivityAsync(reply);
}
else
{
HandleSystemMessage(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
그러나 ActivityTypes.Event가 activity.Name뿐만 아니라 존재하지 않는이 질문의 예를 추가했습니다. 봇 프레임 워크에서 백 채널을 처리하기 위해 특별한 패키지가 필요합니까?
사용중인 BotBuilder의 버전은 무엇입니까? –
Microsoft.Bot.Builder 버전 3.0.0 타겟팅 .net 4.6 – Teragon
정말 오래된 버전입니다. 3.5.5로 업데이트하십시오 –