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. Attachments using the Workflow type of Webhook are limited to a total of 20K bytes. When using this type of Webhook, you must reduce your attachment size or quality to meet the requirement. Optionally, you can separate each attachment into separate posts instead of putting them all in one post. Keep in mind that Microsoft Teams limits the rate at which you can create posts via one webhook. Teams does not return an error if the attachment is too large, the post will just fail to show up in Teams. |
9.6 |