The teams commands in Python™ allow you to create a post in Microsoft Teams channels.
See Python commands for other commands you can use with GainSeeker.
Syntax |
Example |
Description/Remarks |
New or changed in GainSeeker version |
teams.sendwebhook(urls, subject, body, attachments=None) |
mywebhook="https://mycompany.webhook.office.com/ mysubject="A-50RS Length"
boldtext="**Statistics** \n\n" lclx="LCLx: " + "0.500875" + "\n\n" mean="Mean: " + "0.502142" + "\n\n" uclx="UCLx: " + "0.503410" + "\n\n" mymessage= boldtext + lclx + mean + uclx
teams.sendwebhook(mywebhook, mysubject, mymessage)
This code creates the following post in the Teams channel you specify: |
Creates a post in Microsoft Teams channels via incoming webhooks, using the following arguments: urls - URLs of webhooks that
the message will be sent to. This can be a string or a list of
strings. subject - Subject of the post. This must be a string. body - Body of the post. This
must be a string. attachments - List of images
to include in the post (optional).
Returns True if sending the message was successful and False if there were errors. The value of error.stoponerror determines what happens if there is an error creating the post. If True (the default), the script will halt and an error message window will be displayed. If False, an error message will be printed to the console and the script will continue to run. |
9.6 |