Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Sijis Aviles
@sijis
@nzlosh I think they should be independent. They don't have to match the release version of the main project. If there are breaking changes, then some coordination may need to occur but that's far and few right now
Tagging a release sounds like a great idea
Hoping to cut a release early December. I'm considering adding a deprecation notice, in that release, to the built-in slack backends and point folks to v3 as part of message.
Carlos
@nzlosh
Sounds good. The more people we having using slackv3, the more edge cases we'll catch and fix. I saw that the @ mention fix has in the markdown module has been released, so I'll update the requirements file and tag this change as v0.1.0 as a starting point for versioning.
Sijis Aviles
@sijis
Sounds good
Carlos
@nzlosh
OK, v0.1.0 for the slackv3 backend has been released.
Carlos
@nzlosh
@Vaelor The mattermost backend release is currently on v2.0.2 27 Nov 2017. Would you be OK with creating a new release v3.0.0 for the current HEAD on the master branch?
Carlos
@nzlosh
@Vaelor I've opened a PR to create a v2.1.0 release since there aren't any major breaking changes between 2.0.2 so version 3.0.0. wasn't justified. errbotio/errbot-backend-mattermost#52
Carlos
@nzlosh
@sijis should backend maintainers have contributor rights to https://github.com/errbotio/err-backend-gitter? I don't seem to have the ability to create a release for this repo.
Sijis Aviles
@sijis
There should. I can check later tonight and verify
Carlos
@nzlosh
The mattermost backend v2.1.0 has been officially released. https://github.com/errbotio/errbot-backend-mattermost/releases
Sijis Aviles
@sijis
found this article interesting, how chatbot can improve dev/ops workflow (in this case, oncall) https://github.blog/2021-12-01-using-chatops-to-help-actions-on-call-engineers/
alpinweis
@alpinweis
Hi.
I have a message that I need to send to a given Slack channel and pin it to that channel.
Given a slackV3 backend, is there an easy way to do that? So, basically, to add a pin, I need to get the timestamp of the latest message that I sent using something like:
self.send(self.build_identifier(MYCHANNEL), "some text to pin") ?
Carlos
@nzlosh
I don't konw of an easy way that exists to get the timestamp for a message that was sent. I took a quick look but can't see anywhere in errbot's code where a timestamp is created for when a message was sent. If there was such a thing, there'd be no guarantee that errbot's sent timestamp would match Slack's message timestamp so it probably be useless for this case even if it did exist. The bot does see the messages it posts. The message handling code ignores messages from the bot, but perhaps there's a way to get access to the message from the plugin to extract the timestamp?
Sijis Aviles
@sijis
I thought there was a flag that could toggle if the bot ignores itself or not.
alpinweis
@alpinweis
Currently errbot's methods send (in core) and send_message do not seem to return anything, as opposed to, say, slack client's chat_postMessage method.
The latter returns a blob with the posted message's timestamp which is used to pin it. It'd probably make sense for errbot's send/send_message to return something similar. That would make it easy to pin the latest sent message.
Carlos
@nzlosh
I think those functions aren't expected to return anything so that backends can be designed to run synchronously or asynchrously. Your comments got me thinking and there is a callback method that you might be able to use https://errbot.readthedocs.io/en/latest/user_guide/plugin_development/messaging.html#trigger-a-callback-with-every-message-received to get at the message information.
alpinweis
@alpinweis

My bot (slackV3) creates new slack channels. I have a command to rename a channel.

 !channel mv #old-name #new_name

Just noticed if #old_name is passed as an identified slack channel (like when it gets picked from a drop down menu) - the command does not seem to reach the bot and is kind of ignored.
Not sure why. Is this expected?

Carlos
@nzlosh
That should work. Could you create an issue with any debug logs that were created when the command was executed please?
I noticed that slack transforms the channel name into this thing here <#CL8HNNTFY|errbot-dev-test> (errbot-dev-test is the channel name). I'm a little suspicious that markdown processing may be attempting to process it as html content. The slackv3 backend has already been bitten my slacks @ mention format being incorrectly processed by the markdown module.
If it's not markdown having trouble, then my next guess would be the identity parsing code in errbot.
alpinweis
@alpinweis
here is the relevant part of the debug logs
18:05:39 DEBUG    slack_sdk.socket_mode.bui on_message invoked: (message: {"envelope_id":"123...","payload":{...})
18:05:39 DEBUG    slack_sdk.socket_mode.bui A new message enqueued (current queue size: 1)
18:05:39 DEBUG    slack_sdk.socket_mode.bui A message dequeued (current queue size: 0)
18:05:39 DEBUG    slack_sdk.socket_mode.bui Message processing started (type: events_api, envelope_id: 123...)
18:05:39 DEBUG    errbot.backends.slackv3   Event type: events_api
Envelope ID: 123...
Accept Response Payload: False
Retry Attempt: 0
Retry Reason:

18:05:39 DEBUG    slack_sdk.socket_mode.bui Sending a message (session id: 99999, message: {"envelope_id": "123..."})
18:05:39 DEBUG    errbot.backends.slackv3   Received event: {'event': {'type': 'message', 'text': '!channel mv <#C123|chan1> #chan2', }
18:05:39 DEBUG    errbot.backends.slackv3   building an identifier from <#C123|chan1>.
18:05:39 DEBUG    slack_sdk.web.base_client Sending a request - url: https://www.slack.com/api/conversations.info, }
18:05:39 DEBUG    slack_sdk.web.base_client Received the following response - status: 200, headers: ..
18:05:39 DEBUG    errbot.backends.slackv3   Someone mentioned channel #chan1
18:05:39 DEBUG    errbot.backends.slackv3   Event type message not supported.
Carlos
@nzlosh
Can you create a github issue in the slackv3 repo please so that others can find it if they encounter the same sort of situation?
alpinweis
@alpinweis
alpinweis
@alpinweis

Hi. I have a restricted command chat_rm that I define like this:

ACCESS_CONTROLS = {
  .....
  "chat_rm": {"allowusers": BOT_ADMINS},
}

Given a slackV3 backend,
What's the correct way to specify bot admins? I tried 2 options, and in both cases when I try to run the command as a bot admin I get denied.

Using: BOT_ADMINS = ('@flast1', '@flast2')
logs:

12:27:09 INFO     errbot.plugins.ACLs       Matching ACL {'allowusers': ('@flast1', '@flast2')} against username UQQQQQQ for command MyTools:chat_rm.
12:27:09 INFO     errbot.core               Command None blocked or deferred.

Using: BOT_ADMINS = ('@First1 Last1', '@First2 Last2')
logs:

12:27:09 INFO     errbot.plugins.ACLs       Matching ACL {'allowusers': ('@First1 Last1', '@First2 Last2')} against username UQQQQQQ for command MyTools:chat_rm.
12:27:09 INFO     errbot.core               Command None blocked or deferred.
Carlos
@nzlosh
@alpinweis The only secure way to identify a user in slack is via the User ID. From the Slack UI you can view the user's full profile where there is an option to copy their UserID.
Slack changed things and the old @display_name is no longer guaranteed to be unique, which means if someone sets their display name to be the same as an admins display name, they get admin rights to the bot.
I've found the problem you encountered with errbotio/err-backend-slackv3#57 but after fixing the issue, another problem has turned up which is related to how the room mentions are parsed by errbot. I'm in the process of debugging it and if all goes well should have a fix in the next couple of days.
alpinweis
@alpinweis

The only secure way to identify a user in slack is via the User ID.

right, so is something like @UQUSERID or <@UQUSERID> supposed to work for BOT_ADMINS? which one is correct?

Carlos
@nzlosh
The User ID is the plain text id for the slack account, it's what you see when you copy the information from the slack full profile page or using the !whoami command (person field).
Carlos
@nzlosh
Oh and you will need to set the BOT_ADMINS_NOTIFICATIONS configuration if you want admin messages to be sent to from errbot since a plain text id can't be used to send slack notifications.
Sijis Aviles
@sijis
@nzlosh We got https://github.com/errbotio/err-backend-discord migrated to the org :)
Carlos
@nzlosh
Great news! Thanks for sorting that out.
Carlos
@nzlosh
@sijis Would you be for or against errbot-backend-mattermost project being renamed to err-backend-mattermost for consistency sake? The only other backend that uses errbot rather than err is errbot-backend-skype but I think it's deprecated now.
Yamila Moreno
@yamila-moreno
Hi there, I'm struggling with the flow example. I cannot get it running. I'm using telegram backend.
  • where should the flows go? in the plugins directory? in a flows directory? (I've tried both, but not sure)
  • the .flow file should be called myflows.flow like the myflows.py file?
Sijis Aviles
@sijis
@yamila-moreno The layout should be as a normal plugin. Inside the plugins directory.
@nzlosh I can rename it. Not a problem
Carlos
@nzlosh
Thanks @sijis :thumbsup: it'll make it easier for people find/install the backends if they all follow the same naming convention.
Apache-QiBao
@skisqibao
How to integrate the errbot into the web chat tool developed by springboot ?
Sijis Aviles
@sijis
@skisqibao could you elaborate a little on what you are trying to do?
Apache-QiBao
@skisqibao
@sijis Now I have a springboot project, there is a page with a chat function, I want to integrate the errbot into this page
Sijis Aviles
@sijis
@skisqibao I'm guessing that's a custom chat system? If that's the case, you'd have to create a custom backend for your system. If it's xmpp based you could look at the existing xmpp one as a starting point.
Alternative, if you just want to send commands to the bot, you can create a webhook plugin and interact with it that way. But that's just typical API methodology.
Sijis Aviles
@sijis
@nzlosh i just archived the skype backend (errbotio/err-backend-skype). it only supports 2.7, which errbot no longer supports.
Apache-QiBao
@skisqibao
Thanks @sijis
I think I have a general idea.
Carlos
@nzlosh
Thanks for sorting that out. Does skype still exist?
Sijis Aviles
@sijis
maybe, but the library is for py 2.7 and hasn't been touched in 9 yrs. the backend in 6.
Carlos
@nzlosh
I seem to recall Skype being bought my Microsoft and being transformed into teams, but I could be wrong, I don't keep track of Microsoft products.
Stefano Ortolani
@ostefano
@nzlosh does the errbot slackv3 backend supports the bot replying with an image rather than text?
Carlos
@nzlosh
I've never tried personally. There's a method _slack_upload which calls Slack's files_upload API. If the backend doesn't support the method directly, the SlackSDK module is avilable through the backend object as slack_web. There's a method called api_call which was carried forward from the original slack backend that calls SlackSDK's api_call method. It's a thin wrapper giving access to calling the Slack API directly. That might be another way of getting to the functionality you need.