Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jeffrey Jen
@yihungjen_twitter
Hello! On reading bot flow context, is it purely in memory, or does it persists somewhere?
Sijis Aviles
@sijis
I'm pretty sure it persist within the local storage of the plugin.
cryptodog557
@cryptodog557
Hey peeps
Sijis Aviles
@sijis
@cryptodog557 welcome.
Ghost
@ghost~6197d0326da03739848ae44f
Hi folks, I'm currently discovering errbot with zulip.
Is there a way to lower() a function name, allowing to call @bot test and @bot TeSt the same code ?
alpinweis
@alpinweis
Hi. I'm trying to migrate to the SlackV3 backend. How do I call slack API methods now?
It used to be self._bot.api_call(method, data={}). Now any method I try to call complains something like api_call() got an unexpected keyword argument '<somename>'.
Say, I need to call conversations.create with a POST payload.
alpinweis
@alpinweis
I guess I could use self._bot.slack_web directly instead of self._bot.api_call, e.g. self._bot.slack_web.conversations_create(name="test").
Is this the correct way to do it or is there a better/recommended way?
Carlos
@nzlosh
@alpinweis can you open an issue please and I'll take a look
alpinweis
@alpinweis
Thanks @nzlosh. Just opened errbotio/err-backend-slackv3#54
Carlos
@nzlosh
:thumbsup: @alpinweis thanks for that. Having a github issue gets more visibility around the problem and any potential workaround/fix.
alpinweis
@alpinweis
@nzlosh are there plans to tag err-backend-slackv3 releases? when setting up the backend (via git clone err-backend-slackv3) it might help having a more stable version instead of the master head
Carlos
@nzlosh
That'd be a good idea now that it is in its own repository.
@sijis do you have any opinions on how releases for backends should be managed/defined as part of the larger errbot project?
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.