0
Example of responding to a Microsoft Teams command
One script reply has been approved by the moderators Verified

This script respond to a Microsoft Teams command /windmill .

Created by alex308 35 days ago Viewed 3144 times
0
Submitted by alex308 Bun
Verified 35 days ago
1
import * as wmill from "windmill-client"
2

3
export async function main(
4
  activity_id: string,
5
  command: string,
6
  from_name: string,
7
  team_id: string,
8
  teams_message: any
9
) {
10
  // Your business logic
11
  const res = "task completed successfully!"
12

13
  // (optional) Send update to Teams channel about completion of job
14
  await wmill.TeamsService.sendMessageToConversation(
15
    {
16
      requestBody: {
17
        conversation_id: activity_id,
18
        success: true,
19
        text: `Hi, ${from_name}, command: ${command} ran successfully with the following result: ${res}`
20
      }
21
    }
22
  )
23
}