Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Carlos
@nzlosh
Sounds good :thumbsup:
DrHeckerKiller
@DrHeckerKiller
Hi
Can i have mod?
Plss
U w U
Hello?
Pls answer
Sijis Aviles
@sijis
What do I mean, mod?
lowid
@soloradish
Hi every one. I need some help in simple botcmd() use case.
how can I get user identitry who trigger the botcmd ?
I need read user email address from slack backend. I find there is identity.Person in slackv3 backend.
but I'm not able to figure out how to get or 'reflect' user identity in @botcmd decorated function.
Sijis Aviles
@sijis
If you type !whoami you should see the object path to get the info you need. It's be like frm.xxxx
lowid
@soloradish
@sijis thank you!
Sijis Aviles
@sijis
Glad that helped
lowid
@soloradish
I have another question, how should I handle the non-command message from users?
eg. user send text with out leading !, I want send help message back to user.
I found 'def unknown_command'. but this method only handle unmatched command, not plain messages.
how can I achieve this ?
lowid
@soloradish
I finally resolve it. use 'callback_message'. ; )
Carlos
@nzlosh
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