-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we make bot to listen and respond to messages which do not reffer directly to it? Without bot being tagget in the message #36
Comments
The Webex bots do not allow this by design. From https://developer.webex.com/docs/api/guides/bots :
Integrations (https://developer.webex.com/docs/integrations) can be used to process messages that do not require @mentions, but is because integrations act on behalf of a user. |
Thank you. Is there any python library that can support this "integrations"? I would like to make a Bot/Intergation that would check in the messages of the room for specific words in order to take actions |
It's the same API, just a different, more complex authentication mechanism. Theoretically, you could create the auth tokens outside of this library for use with this library, though not directly supported (I suspect) |
Specific to your question, I don't personally know of a library that works directly with the auth flow to make an integration. There are examples about the oauth flow: |
Let me give you another scenario. Let me know please if it works. Lets say that a service is sending via a bot (called XXX) a message to a webex channel. If I run your script with the token of the same XXX bot, is it going to read and react on messages sent by the same XXX bot but via the service from above? I mean the same bot and tokens are used by two in the same time. |
I'm not exactly sure if I understand your question, but when messages come in, they have metadata such as the user/entity e-mail address that sent the message. With that metadata, you can filter the messages to prevent bots from talking to other bots or allow only certain users to interact with the bot. |
I have run your script with the bot token which is set by another service. Once the bot is sending a message via the service, your script is showing me an event with the following text: "Websocket ack message with ID=xxx. Completed'". Question: How can i tune your demo script in order to run action based on the content of the message which was sent by the service (using the same bot token)? Can your libabry read the message which was sent by a other service? It the same bot for service and your demo script. Thank you |
Btw, how can I turn on the Debug mode? How i see only INFO messages. Thanks |
If you used the bot token to send a message from elsewhere and you're using the same bot token to receive notifications, then yes, my understanding is that you'd be able to retrieve that message using the bot token. |
Thank so much, that answers to my question. What would be the simplest code that would respond to echo comand with a text? I see your demo include more complex case by returning adaptive cards... |
Hi, I haven't used this particular library yet, but it looks like you can just create a response = Response()
response.text = "Your message here" |
Yes or even simplier just reply with a string. |
I was able to make what I want. In term of making your script to react on a message which a Bot has created via another service. Another question here: how can I make Bot to reply to a message? In your case Bot is creating a new message, however I want Bot to reply to a message where he was mentioned into. Thanks |
No description provided.
The text was updated successfully, but these errors were encountered: