Skip to content

chat message trigger and html message to chat-id#3746

Open
cypher-hec wants to merge 1 commit intorapid7:masterfrom
cypher-hec:chat_trigger_html_feature
Open

chat message trigger and html message to chat-id#3746
cypher-hec wants to merge 1 commit intorapid7:masterfrom
cypher-hec:chat_trigger_html_feature

Conversation

@cypher-hec
Copy link

@cypher-hec cypher-hec commented Feb 25, 2026

Added ability to microsoft_teams to receive messages from ms-teams chats (or group chats)
Added the ability to send HTML messages also to ms-teams chats also

🎫 Ticket

N/A

🧩 Type of Change

  • Feature
  • Bug fix
  • Other

🧠 Background & Motivation

  • The teams plugin allows to receive messages to react on from MSTeams channels but not from 1:1 or group chats.
  • A lot of companys enforce security that won't allow external people to join teams channels but they can create group chats.
  • This is why i added the ability to trigger on teams chat messages the same way as it is currently available with teams channels
  • additionally the send_html_message action can only send to channels, i added the ability like send_message to also sent to chat-ids

✨ What Changed

  • enhanced microsoft_teams plugin:
    • added new_message trigger for chat/groupchat messages
    • action send_html_message to allow sending to chat-id
    • set teams and channel fields for send_html_message to optional and added exception handling if conditions are not met
    • added unit-tests

🧪 Testing

  • Manual installed on a live ICON instance for 3+ months and heavily used for chatbot functionality
    chatbot
    workflow

  • Unit Tests

# python3 -m unittest test_new_chat_message_received.py -v
test_compile_message_content (test_new_chat_message_received.TestNewMessageReceived) ... ok
test_get_sorted_messages (test_new_chat_message_received.TestNewMessageReceived) ... ok
test_indicators_0 (test_new_chat_message_received.TestNewMessageReceived) ... ok
test_indicators_1 (test_new_chat_message_received.TestNewMessageReceived) ... ok
test_indicators_2 (test_new_chat_message_received.TestNewMessageReceived) ... ok
test_setup_endpoint (test_new_chat_message_received.TestNewMessageReceived) ... ok
test_sort_messages_from_request (test_new_chat_message_received.TestNewMessageReceived) ... ok

----------------------------------------------------------------------
Ran 7 tests in 0.033s

OK

# python3 -m unittest test_send_html_message.py -v
test_send_html_message_0_channel (test_send_html_message.TestSendHtmlMessage) ... ok
test_send_html_message_1_thread (test_send_html_message.TestSendHtmlMessage) ... ok
test_send_html_message_2_chat (test_send_html_message.TestSendHtmlMessage) ... ok
test_send_html_message_bad_0_only_message (test_send_html_message.TestSendHtmlMessage) ... ok
test_send_html_message_bad_1_without_channel (test_send_html_message.TestSendHtmlMessage) ... ok
test_send_html_message_bad_2_without_team (test_send_html_message.TestSendHtmlMessage) ... ok
test_send_html_message_bad_3_without_channel_and_team (test_send_html_message.TestSendHtmlMessage) ... ok

----------------------------------------------------------------------
Ran 7 tests in 0.228s

OK
  • code black'ed

All done! ✨ 🍰 ✨
10 files would be left unchanged.

enhanced send_html_message to allow sending to chat-id
set teams and channel fields for send_html_message to optional and added exceptionhandling if conditions are not met
added unit-tests
@cypher-hec cypher-hec requested a review from a team as a code owner February 25, 2026 17:23
@snyk-io
Copy link

snyk-io bot commented Feb 25, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant