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
lowid
@soloradish
It's very helpful, thank you @nzlosh @sijis
Sijis Aviles
@sijis
@soloradish anytime. Glad to be of help
Carlos
@nzlosh
Good news for discord users, the lead developer of the Python discord.py module has decided to return to active development. https://gist.github.com/Rapptz/c4324f17a80c94776832430007ad40e6
Sijis Aviles
@sijis
That's great!
K Dhanesh
@dhanupreeth_twitter
Hey Folks, Hope you all r doing good.
I need help to configure the slack.
K Dhanesh
@dhanupreeth_twitter
20:05:56 WARNING  slackclient.client        Failed RTM connect
Traceback (most recent call last):
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slackclient/client.py", line 140, in rtm_connect
    self.server.rtm_connect(use_rtm_start=with_team_state, **kwargs)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slackclient/server.py", line 168, in rtm_connect
    raise SlackLoginError(reply=reply)
slackclient.server.SlackLoginError
20:05:56 ERROR    errbot.backends.base      Exception occurred in serve_once:
Traceback (most recent call last):
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backends/base.py", line 861, in serve_forever
    if self.serve_once():
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backends/slack.py", line 453, in serve_once
    raise Exception("Connection failed, invalid token ?")
Exception: Connection failed, invalid token ?
20:05:56 INFO     errbot.backends.base      Reconnecting in 41 seconds (5 attempted reconnections so far).
my Token was accepted.
Carlos
@nzlosh
@dhanupreeth_twitter I recommend using the slackv3 https://github.com/errbotio/err-backend-slackv3 backend
K Dhanesh
@dhanupreeth_twitter
thanks, already I tried got the below error
21:14:44 INFO     errbot.bootstrap          Found Storage plugin: Shelf.
Traceback (most recent call last):
  File "/Users/dhanesh/.pyenv/versions/3.9.0/bin/errbot", line 8, in <module>
    sys.exit(main())
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/cli.py", line 395, in main
    bootstrap(backend, root_logger, config, restore)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/bootstrap.py", line 257, in bootstrap
    bot = setup_bot(bot_class, logger, config, restore)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/bootstrap.py", line 166, in setup_bot
    backendpm = BackendPluginManager(
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backend_plugin_manager.py", line 51, in __init__
    raise PluginNotFoundException(
errbot.backend_plugin_manager.PluginNotFoundException: Could not find the plugin named SlackV3 in ['/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backends’].
Carlos
@nzlosh
You need to installed it. Follow the instructions in the README.
K Dhanesh
@dhanupreeth_twitter
Sure let me try that, I’m using Mac. I’m not able to fix it.
but let me try and will update.
Carlos
@nzlosh
Errbot isn't tested on Mac so it might be an issue. Especially if it's using M1 architecture.
K Dhanesh
@dhanupreeth_twitter
I’m using intel. still I couldn’t resolve it.
K Dhanesh
@dhanupreeth_twitter

@nzlosh In my app location, I’ve created backend directory and cloned the following repo - https://github.com/errbotio/err-backend-slackv3 and then installed via pip install -r ./backend/err-backend-slackv3/requirements.txt Updated the config.py

BOT_EXTRA_BACKEND_DIR="mypath/backend”

And started the app, now getting this error.

21:38:07 ERROR    errbot.backends.base      Exception occurred in serve_once:
Traceback (most recent call last):
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backends/base.py", line 861, in serve_forever
    if self.serve_once():
  File "/Users/dhanesh/dhanu/2022/devopsbot/backend/err-backend-slackv3/slackv3.py", line 273, in serve_once
    self.bot_identifier = SlackPerson(self.slack_web, self.auth["user_id"])
  File "/Users/dhanesh/dhanu/2022/devopsbot/backend/err-backend-slackv3/_slack/person.py", line 50, in __init__
    self._cache_user_info()
  File "/Users/dhanesh/dhanu/2022/devopsbot/backend/err-backend-slackv3/_slack/person.py", line 88, in _cache_user_info
    res = self._webclient.users_info(user=self._userid)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/client.py", line 4192, in users_info
    return self.api_call("users.info", http_verb="GET", params=kwargs)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 145, in api_call
    return self._sync_send(api_url=api_url, req_args=req_args)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 182, in _sync_send
    return self._urllib_api_call(
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 316, in _urllib_api_call
    return SlackResponse(
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/slack_response.py", line 205, in validate
    raise e.SlackApiError(message=msg, response=self)
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/users.info)
The server responded with: {'ok': False, 'error': 'missing_scope', 'needed': 'users:read', 'provided': 'chat:write,im:write'}
K Dhanesh
@dhanupreeth_twitter
I have updated missing_scope.
K Dhanesh
@dhanupreeth_twitter
@nzlosh I have fixed it for mac.
its working
thanks for your help.
Carlos
@nzlosh
Nice to hear!
Eric Berg
@bergbrains

I'm a little stuck trying to figure out how to configure errbot to load modules on start-up. Can anybody point me in the right direction? I'm aware of the tools/plugin-gen.py script, but that appears to only create repos.json with public plugins.

I was deploying the plug-in with the container, but decoupled them, so the mod is loaded dynamically. Just trying to get it to load automatically on start up.

Thanks!

Sijis Aviles
@sijis
@bergbrains you need to put the python/plugin code inside the plugins directory path defined in your config.py file
1 reply
There is a cli option that can create a bare plugin for you. I don't remember offhand but it's osmething like errbot --new-plugin
As long as that code is in that plugin path when errbot bootsup it'll detect it and load it.
Mark Sullivan
@marksull
You have two options: 1) Your docker entrypoint script should pull the module into the plug-in directory within the container prior to your script starting errbot or 2) install the module in a persistent volume outside the docker container which is then mapped to the plug-in directory. In both these cases errbot will see the plug-in and load it.
1 reply
alpinweis
@alpinweis
Hi. Is it possible to have command aliases?
e.g. I have a command like pagerduty_status and I'd like to have a short alias like pd_status for it.
What's the recommended way to do it?
Sijis Aviles
@sijis
@alpinweis there is an alias plugin that should do that already.
I've also created a stub method in the past too.
alpinweis
@alpinweis
@sijis what do you mean by a stub method? do you have examples?
alpinweis
@alpinweis
also, when using the Alias plugin, what's the right way to add aliases during startup? I assume it's probably via running a specific errbot cli in my Dockerfile?
Sijis Aviles
@sijis
For stub method, basically I just created a new method that called the existing one (hard to type on phone, but something like)..

def myoldcmd(..): pass
def newcmd(...): self.myoldcmd(...)
I haven't used that plugin ina while, but if I recall it's stored in the backend (by default a $pluginname.db file). So upon startup the plugin is loaded and the commands should be available
Sijis Aviles
@sijis
If in docker/kube, you may want to use an external backend so that info is stored in a db and not local files
alpinweis
@alpinweis

In my case the long command name has to accept args/options, so the short alias (or the stub method) needs to be declared so that it can accept those options too.
e.g. this is how I imagine I'd define a stub:


    @arg_botcmd("-u", "--user", type=str, help=user name")
    @arg_botcmd("-p", "--project", type=str, help="project name")
    def pagerduty_status(self, msg, project=None, user=None):
      ......


    @arg_botcmd("-u", "--user", type=str, help=user name")
    @arg_botcmd("-p", "--project", type=str, help="project name")
    def pd_status(self, msg, project=None, user=None):
      self._bot._execute_and_send(cmd="pagerduty_status", args=...)

which looks like a lot of duplication.
From a quick view at the Alias plugin I'm not sure the !alias command supports flags with arbitrary values.

I tried something like

   pd_status = pagerduty_status

but that did not seem to work.

Sijis Aviles
@sijis
Ya. My cases were much simpler.
sijis
@sijis:matrix.org
[m]
Testing, under Matrix
Joseph Walton-Rivers
@webpigeon:fossgalaxy.com
[m]
Hi from matrix o/
sijis
@sijis:matrix.org
[m]
Joseph Walton-Rivers
@webpigeon:fossgalaxy.com
[m]
https://git.fossgalaxy.com/irc/errbot/backend-matrix is a matrix backend if you need it, mostly works :)
sijis
@sijis:matrix.org
[m]
Thanks. I'm trying to simplify my phone messaging apps
sijis
@sijis:matrix.org
[m]
Joseph Walton-Rivers: that's cool. I'm glad to see teams still using errbot :)
sijis
@sijis:matrix.org
[m]
I just released errbot version 6.1.9!
Versions are on pypi.org and dockerhub.