![]() So, for example, if you wish for the bot to monitor not only new messages in a room, but also any card actions in a room, you would instanciate the bot like this: The bot can also be configured to listen for multiple different events. The first argument, "memberships", tells the bot to look for resources of the type "memberships", the second argument "*" instructs the bot that this is not something that should be included in the internal "help" command, and the third command is the function to execute to handle the membership creation. add_command( 'memberships', '*', check_memberships) Return "'" + pemail + "' was automatically removed from this space it is restricted to only " \ create( toPersonId = pid, markdown = "You were automatically removed from the space because " "it is restricted to employees.") # membership check failed print( "membership failed. # membership check succeeded return "" else: # check membership:all webhook to verify that person added to room (or otherwise modified) is allowed to be in the room def check_memberships( api, incoming_msg): You can do that with the "set_help_message" command like this: Although "set_greeting" has existed for a while now, you may mostly like the internal greeting mechanism, but only want to change the help banner itself.run( host = "0.0.0.0", port = 5000)Ī sample script that shows more advanced bot features and customization is also provided in the repo.Īdvanced Options Changing the Help Message add_command( "/dosomething", "help for do something", do_something) :param incoming_msg: The incoming message object from Teams :return: A text or markdown based reply """ return "i did what you said - ". ![]() ![]() # A simple command that returns a basic string that will be sent as a reply def do_something( incoming_msg): Import os from webexteamsbot import TeamsBot # Retrieve required details from environment variables bot_email = os. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |