If you have a coding question, you can use stackoverflow with the tag 'errbot' and 'python'
sijis on master
Update README.md with new URL (… (compare)
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!
errbot --new-plugin
def myoldcmd(..): pass
def newcmd(...): self.myoldcmd(...)
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.
I'm in favour of keeping slackv3 outside of the errbot core repo so the backend developers can remain autonomous and apply fixes/features on different release cycles to the core.
If we must merge slackv3 for other reasons, I'd like to see the other backends merge into the core also for consistency sake, at least mattermost and discord (gitter perhaps).
A couple of other backends that'd be good to have in the errbot.io organisation would be MSTeam, Matrix and Keybase (I'm not sure if such a backend would fit with Errbot's architecture).
errbot -h
. Has anyone else seen this?(errbot) root@u1804:/opt/errbot# errbot -h
Traceback (most recent call last):
File "/opt/errbot/bin/errbot", line 5, in <module>
from errbot.cli import main
File "/opt/errbot/lib/python3.7/site-packages/errbot/cli.py", line 27, in <module>
from errbot.bootstrap import CORE_BACKENDS
File "/opt/errbot/lib/python3.7/site-packages/errbot/bootstrap.py", line 10, in <module>
from errbot.plugin_manager import BotPluginManager
File "/opt/errbot/lib/python3.7/site-packages/errbot/plugin_manager.py", line 8, in <module>
from graphlib import CycleError
ModuleNotFoundError: No module named 'graphlib'
graphlib-backport==1.0.3
was missing from the virtualenv. I'm not sure how pip handles dependency resolution when processing wheels, but my current guess is the errbot wheel was built on a version > 3.9 so graphlib-backport
wasn't included. I'll need to dig into how all this works under the hood.
py37.py38
built using py3.7 or py3.8 and another tagged with py39.py310
built using py3.9 or py3.10. I'm not sure if the original wheel tagged with py3
would need to be taken down or if pip will select the most specific version first.
I'm stuck trying to post the payload
received by a webhook function to a Mattermost channel. This is what my webhook function looks like:
@webhook
def github_issues(self, payload):
self.log.debug(repr(payload))
return(payload)
Expected Outcome: I expect that return(payload)
should forward the received payload
to the Mattermost channels I've added my bot to. My bot account currently sits in two Mattermost channels
How it's Working Out: The payload is reaching the function, but it's not being forwarded to the channels I've added the bot to.
Is there anything I need to fix in the function or anywhere to make this arrangement work?
send()
to push data to the backend. This is my updated function just in case someone else needs it: @webhook
def github_issues(self, payload):
for room in self.rooms():
self.send(
self.build_identifier(f"~{room.name}"),
'Title: Issue {0}!\n Issue URL: {1}'.format(payload['action'], payload['issue']['url']),
)