我在私人消息中为Skype创建了Bot,他可以正常使用,但在组中却没有响应。
查看我的代码:
[BotAuthentication]
public class MessagesController : ApiController
{
/// <summary>
/// POST: api/Messages
/// receive a message from a user and send replies
/// </summary>
/// <param name="activity"></param>
[ResponseType(typeof(void))]
public virtual async Task<HttpResponseMessage> Post([FromBody] Activity activity)
{
// check if activity is of type message
if (activity != null && activity.GetActivityType() == ActivityTypes.Message)
{
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
Random random = new Random();
string resposta = string.Empty;
if (activity.Text.ToLower().StartsWith("guid"))
resposta = Guid.NewGuid().ToString();
else if (activity.Text.ToLower().StartsWith("empty"))
resposta = Guid.Empty.ToString();
// return our reply to the user
if (!string.IsNullOrEmpty(resposta))
{
Activity reply = activity.CreateReply(resposta);
await connector.Conversations.ReplyToActivityAsync(reply);
}
}
else
{
HandleSystemMessage(activity);
}
return new HttpResponseMessage(System.Net.HttpStatusCode.Accepted);
}
}
但是他在我的频道配置中的状态为“ inReview”。
怎么了?