-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JS] feat: add helper functions to to get Teams channels, members, an…
…d details (#1949) ## Linked issues closes: #minor ## Details Provide a list of your changes here. If you are fixing a bug, please provide steps to reproduce the bug. #### Change details > We have encapsulated three APIs from [`TeamsInfo`](https://github.com/microsoft/botbuilder-js/blob/main/libraries/botbuilder/src/teamsInfo.ts) class of `botbuilder` library: `getTeamChannels`, `getTeamDetails`, and `getPagedMember`, to facilitate easier proactive message sending. These three APIs have been wrapped as an initial sample. If this approach is deemed acceptable, we intend to extend this encapsulation to include additional APIs provided by `TeamsInfo`, such as `sendMessageToListOfUsers`, `sendMessageToAllUsersInTenant`, and more. PM Contact: @MuyangAmigo **code snippets**: To use the APIs: ```ts for (const reference of conversationReferences) { await app.sendProactiveActivity( reference, "Proactive message from RestifyNotiBot!" ); if (reference.conversation?.conversationType === "channel") { const details = await app.getTeamDetails(reference); const teamMembers = await app.getPagedMembers(reference); console.log(details, teamMembers.members.length); } } ``` **screenshots**: Results are printed as belows, furthur  ## Attestation Checklist - [ ] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below --------- Co-authored-by: Yiqing Zhao <[email protected]> Co-authored-by: Corina <[email protected]>
- Loading branch information
1 parent
cd919c0
commit a8cc2c2
Showing
2 changed files
with
453 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.