UNPKG

@andrewcturing/microsoft_teams

Version:

Pipedream Microsoft Teams Components

45 lines (40 loc) 954 B
import microsoftTeams from "../../microsoft_teams.app.mjs"; export default { key: "microsoft_teams-send-chat-message", name: "Send Chat Message", description: "Send a message to a team's chat. [See the docs here](https://docs.microsoft.com/en-us/graph/api/chat-post-messages?view=graph-rest-1.0&tabs=http)", type: "action", version: "0.0.1", props: { microsoftTeams, chatId: { propDefinition: [ microsoftTeams, "chat", ], }, message: { propDefinition: [ microsoftTeams, "message", ], }, }, async run({ $ }) { const { chatId, message, } = this; const response = await this.microsoftTeams.sendChatMessage({ chatId, content: { body: { content: message, }, }, }); $.export("$summary", `Successfully sent message to chat ${chatId}`); return response; }, };