如何在 MS Teams 基于搜索的消息传递扩展请求中配置查询的分页参数?

How to configure query's pagination parameters in MS Teams Search Based Messaging Extension request?

我正在使用基于 MS 团队搜索的消息扩展。

https://docs.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/search-commands/respond-to-search?tabs=dotnet#default-query 在我得到的默认查询中 - “queryOptions”:{ “跳过”:0, “计数”:25 }

有没有办法自定义这个计数。

我没有找到任何更新 queryOptions 的支持文档,但您可以在代码中手动处理它,并设​​置您希望最初显示的项目数以及搜索时显示的项目数。当消息扩展最初是 运行 时,查询参数名称设置为 "initialRun",所以在这里你可以如何使用它

if (query.Parameters[0].Name == "initialRun")
{
    // Write the code handling number of results to be return.
}
else
{
    // Write the code handling number of results to be return when user search.
}

谢谢