microsoft/teams.net
Publicmirrored from https://github.com/microsoft/teams.netAvailable
core/samples/AllInvokesBot/README.md
52lines · modecode
| 1 | # AllInvokesBot Testing Guide |
| 2 | |
| 3 | A sample bot demonstrating Teams invoke handlers. |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | 1. Configure bot credentials in `appsettings.json` or environment variables |
| 8 | 2. Run the bot: `dotnet run` |
| 9 | 3. Upload `manifest.json` to Teams |
| 10 | |
| 11 | ## Testing Handlers |
| 12 | |
| 13 | ### OnMessage |
| 14 | **Manifest:** `bots` section with appropriate `scopes` (personal, team, groupChat) |
| 15 | |
| 16 | 1. Send any message to the bot in 1:1 chat |
| 17 | 2. Verify welcome card with action buttons appears |
| 18 | |
| 19 | ### OnAdaptiveCardAction |
| 20 | **Manifest:** No specific requirement (triggered by adaptive card actions) |
| 21 | |
| 22 | 1. After receiving the welcome card |
| 23 | 2. Click any action button on the card |
| 24 | 3. Verify action response card appears |
| 25 | 4. Console logs will show the verb and data |
| 26 | |
| 27 | **File Upload Flow:** |
| 28 | 1. Click "Request File Upload" button |
| 29 | 2. Verify file consent card appears |
| 30 | |
| 31 | ### OnFileConsent |
| 32 | **Manifest:** `bots.supportsFiles: true` |
| 33 | **Azure:** Delegated permission `Files.ReadWrite.All` required in Azure app registration |
| 34 | |
| 35 | 1. After requesting file upload (see above) |
| 36 | 2. Click Accept or Decline on the file consent card |
| 37 | 3. If Accept - verify file uploads and file info card appears |
| 38 | 4. If Decline - verify console logs the decline action |
| 39 | |
| 40 | ### OnTaskFetch |
| 41 | **Manifest:** No specific requirement (triggered by task module actions) |
| 42 | |
| 43 | 1. Click "Open Task Module" button on the welcome card |
| 44 | 2. Verify task module dialog opens with input form |
| 45 | |
| 46 | ### OnTaskSubmit |
| 47 | **Manifest:** No specific requirement (works with OnTaskFetch) |
| 48 | |
| 49 | 1. Open task module (see OnTaskFetch) |
| 50 | 2. Fill in the form |
| 51 | 3. Click submit |
| 52 | 4. Verify "Done" message appears |
| 53 | |