For support or coding questions, please use Stackoverflow with the errbot tag (+ python): http://stackoverflow.com/questions/tagged/errbot
See all
Members (341)
Guillaume Binet's profile photo
Andri Burman's profile photo
Sascha Hintermann's profile photo
Fernando Tricas García's profile photo
Paul Cooper's profile photo
Zach Norris's profile photo
Aaron Lin's profile photo
Ahmed Kamal's profile photo
Will Jones's profile photo
Andy Cheesman's profile photo
Ya Guo's profile photo
David Marclay's profile photo
Jason O'Connell's profile photo
JT Tieman's profile photo
Marc Hughes's profile photo
Stephen Vigus's profile photo
Will Fife's profile photo
Jeff Ling's profile photo
Jeff Bass's profile photo
James Long's profile photo
Fulvio Chionetti's profile photo
Emanuel de melo's profile photo
Greggory Tucker's profile photo
Joshua Dufresne's profile photo

Stream

Join this community to post or comment
Pinned by moderator
 
We are moving the support from Google+ to stackoverflow ! It is way easier for people knowledgeable to find your questions and format responses: Just use the tag "errbot" (+ python is a good idea too) like those http://stackoverflow.com/questions/tagged/errbot. Thanks for making this community awesome, we will still use Google+ but not for support or coding questions !
edit: typos
2
Add a comment...
 
Problem sending command to errbot in slack (chat to one)
If understood well, to install plugins is neccesary put my user in BOT_ADMIN and open chat_to_chat with mybot to send commands as !repo install .....

but always I have this exception
ile "/root/.errbot-ve/lib/python3.5/site-packages/errbot/backends/slack.py", line 455, in <listcomp>
user = [user for user in self.sc.server.users if user.name == name]


but commands from channels works well. My bot_admin ...BOT_ADMINS = ('@gbin','@ajalonsov')
Could someone help me?
Thanks in advance

1
Alejandro Jesús Alonso Villar's profile photoNick Groenen's profile photo
3 comments
 
Errbot 4.3.5 has just been released which contains a fix for this: https://pypi.python.org/pypi/errbot/4.3.5
Add a comment...
 
Hello!
I've been poring through the Errbot documentation (and am super new to programming, this is my first hacked together project!) but cannot figure out how to make it so that if I send a command, Errbot responds to me privately with Hipchat. Anyone happen to have any ideas on how I can do that?

Thank you!
1
Skyler H's profile photoGuillaume Binet's profile photo
3 comments
 
simply add a python and errbot tag like this question : http://stackoverflow.com/questions/tagged/errbot thanks !
Add a comment...
 
Is it possible to connect to both XMPP and Slack backends with Errbot? Or will I have to pick one and then write a gateway plugin?
1
Guillaume Binet's profile photoMike Taylor (bear)'s profile photo
5 comments
 
My first pass is to make it so that my team can send commands from slack and have the bot recognize them. I'm loving Errbot more and more so I will be looking into using existing backend code for sure (especially for message routing and stuff)

No public repo yet, lots of private knowledge hard-coded in my prototype.
Add a comment...
 
Hi All!

I am having a problem getting Errbot to connect to hipchat. I've included the error below. I feel like im so freaking close!

14:55:18 DEBUG    errbot.storage            Opening storage 'hipchat_backend'
14:55:18 DEBUG    errbot.storage.shelf      Open shelf storage /var/lib/err/hipchat_backend.db
14:55:18 DEBUG    errbot.plugin_manager     All plugin roots:
14:55:18 DEBUG    errbot.plugin_manager     -> /usr/lib/python2.7/site-packages/errbot/core_plugins
14:55:18 DEBUG    errbot.plugin_manager     Add /usr/lib/python2.7/site-packages/errbot/core_plugins to sys.path
14:55:18 DEBUG    errbot.plugin_manager     check dependencies of /usr/lib/python2.7/site-packages/errbot/core_plugins
14:55:18 DEBUG    errbot.plugin_manager     /usr/lib/python2.7/site-packages/errbot/core_plugins has no requirements.txt file
14:55:18 INFO     errbot                    webhooks:  Flag to bind /echo to echo
14:55:18 DEBUG    yapsy_loaded_plugin_ChatR LOADING CHATROOM
14:55:18 DEBUG    errbot.main               Start serving commands from the hipchat backend
14:55:18 DEBUG    sleekxmpp.xmlstream.resol DNS: Querying SRV records for chat.hipchat.com
14:55:19 DEBUG    sleekxmpp.xmlstream.resol DNS: Querying chat.hipchat.com for AAAA records.
14:55:19 DEBUG    sleekxmpp.xmlstream.resol DNS: No AAAA records for chat.hipchat.com
14:55:19 DEBUG    sleekxmpp.xmlstream.resol DNS: Querying chat.hipchat.com for A records.
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Connecting to 52.23.183.22:5222
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: connected
14:55:19 DEBUG    sleekxmpp.thirdparty.stat  ==== TRANSITION disconnected -> connected
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Starting HANDLER THREAD
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Loading event runner
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst SEND (IMMED): <stream:stream to='chat.hipchat.com' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <stream:stream version="1.0" from="chat.hipchat.com" id="d69e65061ac76255">
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls></stream:features>
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst SEND (IMMED): <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls>
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
14:55:19 DEBUG    sleekxmpp.features.featur Starting TLS
14:55:19 INFO     sleekxmpp.xmlstream.xmlst Negotiating TLS
14:55:19 INFO     sleekxmpp.xmlstream.xmlst Using SSL version: TLS 1.0
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst CERT: -----BEGIN CERTIFICATE---
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: ssl_cert
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst SEND (IMMED): <stream:stream to='chat.hipchat.com' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <stream:stream version="1.0" from="chat.hipchat.com" id="ac3d52d57ed1e45f">
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><auth xmlns="http://jabber.org/features/iq-auth" /><auth xmlns="http://hipchat.com" /><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>X-HIPCHAT-OAUTH2</mechanism></mechanisms><authrestartlogic xmlns="http://hipchat.com" /><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression></stream:features>
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst SEND (IMMED): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">AGJtdWxsZW5iYWNoK19nbWFpbC5jb20AQnVyZzNyazFuZyE=</auth>
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><invalid-authzid /></failure>
14:55:19 INFO     sleekxmpp.features.featur Authentication failed: invalid-authzid
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: failed_auth
14:55:19 ERROR    sleekxmpp.features.featur No appropriate login method.
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: no_auth
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: failed_auth
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: session_end
14:55:19 DEBUG    sleekxmpp.xmlstream.xmlst SEND (IMMED): </stream:stream>
14:55:19 INFO     sleekxmpp.xmlstream.xmlst Waiting for </stream:stream> from server
14:55:23 DEBUG    sleekxmpp.xmlstream.xmlst Waiting for 3 threads to exit.
14:55:23 DEBUG    sleekxmpp.xmlstream.xmlst Stopped event runner thread. 2 threads remain.
14:55:23 DEBUG    sleekxmpp.xmlstream.xmlst Stopped send thread. 1 threads remain.
14:55:24 DEBUG    sleekxmpp.xmlstream.sched Quitting Scheduler thread
14:55:24 DEBUG    sleekxmpp.xmlstream.xmlst Stopped scheduler thread. 0 threads remain.
14:55:24 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: disconnected
14:55:24 INFO     errbot.errBot             Disconnect callback, deactivating all the plugins.
14:55:24 DEBUG    sleekxmpp.thirdparty.stat  ==== TRANSITION connected -> disconnected
14:55:24 ERROR    sleekxmpp.xmlstream.xmlst Error reading from XML stream.
14:55:24 DEBUG    errbot.backends.xmpp      Trigger disconnect callback
14:55:24 INFO     errbot.errBot             Disconnect callback, deactivating all the plugins.
14:55:24 DEBUG    errbot.backends.xmpp      Trigger shutdown
14:55:24 DEBUG    errbot.storage            Closed storage 'hipchat_backend'
14:55:24 INFO     errbot.plugin_manager     Shutdown.
14:55:24 DEBUG    errbot.storage            Closed storage 'core'
14:55:24 INFO     errbot.plugin_manager     Bye.
14:55:24 DEBUG    errbot.storage            Closed storage 'repomgr'
14:55:24 INFO     errbot.err                Process exiting
1
Blake Mullenbach's profile photoNick Groenen's profile photo
5 comments
 
Excellent, glad to hear it's working now. Do you think there's anything we could have done to make the instructions on that page more clear and understandable?
Add a comment...

Guillaume Binet
owner

General  - 
 
 
Be careful #errbot users: don't commit your config.py in your plugin projects.

The best way to do it is to be sure to add it to your .gitignore like it is set on the errbotio/errbot project here: https://github.com/errbotio/errbot/blob/master/.gitignore

#chatops #chatbot
TL;DR, Developers are leaking access tokens for Slack widely on GitHub, in public repositories, support tickets and public gists. They are extremely easy to find due to their structure. It is clear that the knowledge about what these tokens can be used for with malicious intent is not on top of ...
2
Add a comment...
 
The documentation on Identifiers doesn't have code examples, so this is what I somehow came up with. Someone recommended that I use a string representation of the Identifier instead of the ID itself, but I'm not sure how!

I use Slack, and text backend for development locally.

Goal: This is a "subscribe for updates" type function, if a user DM's the bot, the user should be updated. If a user in a channel subscribes, the channel should be updated ... My (simplified) solution was:

    if mess.frm.client is not None and mess.frm.client.startswith('C'):
        channel_subscribers.append(mess.frm.client)
    else:
        user_subscribers.append(mess.frm.person)

Later when it's time to send updates to subscribers I do this:

    for u in user_subscribers:
            if self._bot.mode == 'slack':
                u = '<@%s>'% u
            self.send(self.build_identifier(u), msg)
        for c in channel_subscribers:
            if self._bot.mode == 'slack':
                c = '<#%s>' % c
            self.send(self.build_identifier(c), msg)

It has worked up until 4.0.3 (thus https://github.com/errbotio/errbot/issues/713) but I may be doing it wrong?
I am using the Redis storage backend, and trying to send a message to a slack channel. I have a "channel subscriber" list which contains: 127.0.0.1:6379[2]> get errbot:EBEvents:ff-channel-subscrib...
1
Nick Groenen's profile photoEthan Miller's profile photo
3 comments
 
Thanks! 

I think I expected to find it in http://errbot.io/en/latest/user_guide/plugin_development/messaging.html , maybe a "Responding to users" section? I checked http://errbot.io/en/latest/user_guide/backend_development/index.html#identifiers after Messaging
Add a comment...
 
Help!

I've been all over the Internet trying to figure out why my Hipchat backend won't load. I'm completely new to code, so the most basic help would be extremely useful!

Any ideas?

17:51:41 ERROR    yapsy                     Unable to import plugin: /usr/local/lib/python2.7/site-packages/errbot/backends/hipchat
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/yapsy/PluginManager.py", line 488, in loadPlugins
    candidate_module = imp.load_module(plugin_module_name,plugin_file,candidate_filepath+".py",("py","r",imp.PY_SOURCE))
  File "/usr/local/lib/python2.7/site-packages/errbot/backends/hipchat.py", line 6, in <module>
    from functools import lru_cache
ImportError: cannot import name lru_cache
17:51:41 ERROR    errbot.main               Unable to load or configure the backend.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/errbot/main.py", line 89, in setup_bot
    bot = backendpm.get_plugin_by_name(backend_name)
  File "/usr/local/lib/python2.7/site-packages/errbot/specific_plugin_manager.py", line 87, in get_plugin_by_name
    raise Exception(u'Error loading plugin %s:\nError:\n%s\n' % (name, formatted_error))
Exception: Error loading plugin Hipchat:
Error:
<type 'exceptions.ImportError'>:
  File "/usr/local/lib/python2.7/site-packages/yapsy/PluginManager.py", line 488, in loadPlugins
    candidate_module = imp.load_module(plugin_module_name,plugin_file,candidate_filepath+".py",("py","r",imp.PY_SOURCE))
  File "/usr/local/lib/python2.7/site-packages/errbot/backends/hipchat.py", line 6, in <module>
    from functools import lru_cache
1
Nick Groenen's profile photoSkyler H's profile photo
9 comments
 
Hey +Nick Groenen , thanks so much for the help! I'll try it on Python3 for now, but a permanent fix would be tremendous. :) 
Add a comment...
 
I had a problem setting up my bot with slack in windows, that I fixed by removing the .decode from UTF-8 in line 203 in backends\slack.py

Just posting in case it helps someone or is a bug :)
1
Nick Groenen's profile photoBrandon Downs's profile photo
4 comments
 
Thank you!!
Add a comment...
 
Hello, I just setup Errbot with a slack backend however I'm unclear as what to set for the BOT_ADMIN. I've tried my username my slack user_id U0FGL... What do I do to setup my admin user?
1
Mike Arbelaez's profile photo
 
I figured it out I need the @ sign before the username.

Add a comment...

About this community

Err is a plugin based chatbot designed to be easily deployable, extensible and maintainable. It allows you to start scripts interactively from your chatrooms for any reason: random humour, starting a build, monitoring commits, triggering alerts ...
 
Confused.
I run the following:

>>> !help
Computer says nooo. See logs for details:
'ascii' codec can't encode character '\u2022' in position 75: ordinal not in range(128)

>>>

How do I fix this?
1
Add a comment...

Lucille Winsor

Feature Discussions  - 
 
Global Chatbots Market Demand, Size & Report 2021
1
Add a comment...

Dig Deeper

General  - 
 
Hi dear developers,
here is some feedback for the documentation (sorry, I am not into doing this on github, so sharing it this way):

On the page
http://errbot.io/en/latest/user_guide/plugin_development/botcommands.html
the regex examples only work if the python code includes
import re
from errbot import BotPlugin, re_botcmd
This is not shown in all regex examples on the page and also not included in the demo template code that is generated with --new-plugin
Maybe you could add that. :-)

On the page
http://errbot.io/en/latest/user_guide/configuration/hipchat.html
it talks about "Slack users", should be "HipChat users"

Furthermore I still fail to understand what the correct settings are to connect with a hosted HipChat instance.
I have set my endpoint accordingly and it connects ok.

Assuming my hosted hipchat instance endpoint is "hipchat.example.com"
However the username is not what it shows in
hipchat.example.com/account/xmpp as Jabber ID (this is something like 1_1234@chat.btf.hipchat.com which is clearly wrong and does not work, as I do not have any account there).
Is there some misconfiguration by the admins of the hosted HipChat instance?
Anyway, using trial-and-error I figured out that
1_1234@hipchat.example.com
works, the bot shows up and I can talk to it. But I am still getting some errors in the log when err starts up:
ERROR sleekxmpp.xmlstream.xmlst Error processing event handler: <bound method HipchatBackend.connected of <yapsy_loaded_plugin_Hipchat_0.HipchatBackend object at 0x7fe8fe4a3908>>
ERROR sleekxmpp.basexmpp JID could not be parsed

I have no idea if this is really an issue, but it sounds like it may become one later on when handling user IDs.

Unfortunately I do not have access to the hosted HipChat configuration (corporate) - if anyone has experience with it, e.g. what to check for, how to configure it properly for XMPP compatibility etc.
I would appreciate some hints, like what the Jabber info on page
/account/xmpp
should ideally look like
1
Nick Groenen's profile photo
2 comments
 
Also, out of curiosity, is there any specific reason you're not into doing this on GitHub? As it's our main platform for tracking and managing issues, having these types of conversations there is easier for us and reduces the chances of things getting lost.
Add a comment...
 
If I'm developing a new backend, does the "under development" backend plug-in have to live in the backends folder in the Errbot distribution or is there a way to tell config.py to look in my local plug-ins directory?
1
Guillaume Binet's profile photoScott Schultz (Slickriptide)'s profile photo
2 comments
 
Great, thanks!
Add a comment...
 
I've got a question with a long setup, so please bear with me.

At the moment, I have a working bot. However, it does a lot of event-handling at the SleekXMPP level and is likely to need do a lot more. This has to do with special sub-stanzas that are being sent by the chat service. For instance, the <Presence> stanza can contain information about a player's graphical avatar, while the <Message> stanza can contain a <Channel> substanza that affects how a message is displayed to the recipient.

I am thinking that I would like to move all of the SleekXMPP code into a custom backend that is based on the XMPP backend. I wouldn't be changing the XMPP backend, rather I would be extending things like XMPPPerson() to include the avatar as part of the record of a "person". I would be modifying send_message() to take the channels into account, and so on.

Let's call this new backend PChat() (since that's what I called it, heh).

My issue is how do I communicate to a vanilla Errbot plugin that there is more data than what is defined in errbot.backends.base for objects like Person, Room, Presence, Message, and so on?

This is complicated by the existence of third-party plugin repositories. If someone using my bot wants to install a plugin from a Git repository, that extra plugin should be able to run without knowing or caring anything about the backend.

Message has the "extras" parameter, which could be sufficient for passing channel information up to the "user plugin" layer. Plugins that didn't know or care about channels could just ignore it and I can set appropriate defaults for channels that are not provided as part of an outgoing message.

Presence is murkier. There's no "extras" attribute on Presence to stuff additional information into. Likewise for Room, Person and the rest.

I guess my question is how do I "extend" the existing Errbot objects without breaking things for some other plugin that doesn't know about the extensions? Do I have to keep a separate storage area for the "extras" and my PChat-aware plugins have to know they should do a separate query of the backend for things like avatar or channel information?
1
Guillaume Binet's profile photoScott Schultz (Slickriptide)'s profile photo
4 comments
 
Great, thanks for the help :)
Add a comment...

Kan Wu

General  - 
 
Is there a way to let bot to create a new chat room? If so, is there sample code for that? Thanks!
1
Nick Groenen's profile photoKan Wu's profile photo
5 comments
Kan Wu
 
Let me give a try, thanks for the information.
Add a comment...
 
Hipchat backend and BOT_ADMINS.

Hi all, first thing, there is a typo in http://errbot.io/en/latest/user_guide/configuration/hipchat.html#bot-admins

"You can set BOT_ADMINS to configure which Slack users" Slack? It's a hipchat doc.

And seconf thing about the hipchat configuration itself. I cant set BOT_ADMINS for hipchat. Something simple like '@username' is not working. If I look into logs I see something like:

"Processing command 'check_consul' with parameters '' from 70751_chatops@conf.hipchat.com/Proskurin Kirill" - nice username! But even if I use this one it wont work. And if I try to call a command to bot directly(not in the chat room) username even more bizzare:

"Processing command 'check_consul' with parameters '' from 70751_3749374@chat.hipchat.com/web||proxy|proxy-b206.hipchat.com|5232"

So, my question is - how to set BOT_ADMINS for hipchat?
1
Guillaume Binet's profile photoKirill Proskurin's profile photo
11 comments
 
Ok, got it. Thanks for help!
Add a comment...

err

General  - 
 
We are very proud to announce that Errbot 4.0 is out !

Similar to the jump from 2.3 to 3.0, this new major release is a big step forward with only few incompatible changes compared to 3.2.

First, we would like to thank all the contributors and supporters for this awesome release.

Here are some of the highlights from this release.

User features:
- instead of persisting the bot state on disk, you can now (optionally) use databases like RDBMs (PostgreSQL, MySQL, etc), Redis, Google Firebase and Google Cloud Datastore (local Shelve storage is still the default and still works out of the box with no extra configuration necessary).
- you can now lock down the bot by filtering out core_plugins
- there is no more "favorite plugins", you !repos search and can find and install anything from the ~300 public plugins available.
- a new skype backend
- more flexible and advanced access control features

Developer features:
- a new scaffolding option to create super quickly a plugin (--new-plugin)
- identifiers had a long story on Errbot, this release simplifies them even further and unify them with the room identifiers.
- a new callback_mention that is called when anybody is mentioned in the chatrooms

Many smaller improvements have also been made and various bugs have been fixed. Please review the changelog carefully before upgrading at:

https://github.com/errbotio/errbot/blob/4.0/CHANGES.rst

If you need help, feel free to jump into our chatroom at https://gitter.im/errbotio/errbot


3
1
Add a comment...
 
When errbot is loading I receive the message, "WARNING:root:Starting errbot with a default system encoding other than 'utf-8' might cause you a heap of troubles. Your current encoding is set at 'ascii'

When I browse the config I'm not seeing any where to set the default encoding. What do I do to start errbot in utf-8 mode?
1
Guillaume Binet's profile photoMike Arbelaez's profile photo
2 comments
 
OSX 10.10.5
Add a comment...
 
Hi Guys

How do I embed an image into an errbot message? I've got plugins (and my custom comands) and the bot working fine using an a XMPP backend.

My master plan is to use Errbot to trigger an attached webcam to take a photo and post the results in the message 
1
Guillaume Binet's profile photoAndy Cheesman's profile photo
9 comments
 
+Guillaume Binet AWESOME!
Add a comment...