Created
October 1, 2022 12:56
-
-
Save SibeeshVenu/f7262bb8a22c7e84041e16b3f71df7f7 to your computer and use it in GitHub Desktop.
Send message to Microsoft Teams channel
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
import asyncio | |
import pymsteams | |
loop = asyncio.get_event_loop() | |
def notify_to_teams(message: str, web_hook_url: str, web_hook_name: str): | |
'''This function will notify the message in the Teams channel''' | |
my_teams_message = pymsteams.async_connectorcard(web_hook_url) | |
my_teams_message.title(web_hook_name) | |
my_teams_message.text(message) | |
# to send the message, pass to the event loop | |
loop.run_until_complete(my_teams_message.send()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment