Errbot: How to properly configure new plugins?

1.1k Views Asked by At

I'm trying to follow the Errbot guide to create a new HelloWorld plugin. However, after my errbot has successfully connected to HipChat, I am unable to see the new plugin that I created. This is the DEBUG output from the console.

16:44:02 INFO     errbot.specific_plugin_ma storage search paths {'/home/eugine/errbot-root/plugins/learning', '/home/eugine/lib/python3.5/site-packages/errbot/storage', '/home/eugine/errbot-root/plugins/err-example'}
16:44:02 INFO     errbot.specific_plugin_ma Found those plugings available:
16:44:02 INFO     errbot.specific_plugin_ma     Helloworld  (/home/eugine/errbot-root/plugins/learning/helloworld.py)
16:44:02 INFO     errbot.specific_plugin_ma          Shelf  (/home/eugine/lib/python3.5/site-packages/errbot/storage/shelf.py)
16:44:02 INFO     errbot.specific_plugin_ma         Memory  (/home/eugine/lib/python3.5/site-packages/errbot/storage/memory.py)
16:44:02 INFO     errbot.specific_plugin_ma        Example  (/home/eugine/errbot-root/plugins/err-example/example.py)
16:44:02 INFO     errbot.bootstrap          Found Storage plugin: 'Shelf'
Description: This is the storage plugin for the traditional shelf store for errbot.
16:44:02 DEBUG    errbot.specific_plugin_ma Refilter the plugins...
16:44:02 WARNING  yapsy                     Plugin candidate '/home/eugine/errbot-root/plugins/learning/helloworld.plug'  rejected by strategy 'SpecificBackendLocator'
16:44:02 WARNING  yapsy                     Plugin candidate '/home/eugine/lib/python3.5/site-packages/errbot/storage/memory.plug'  rejected by strategy 'SpecificBackendLocator'
16:44:02 WARNING  yapsy                     Plugin candidate '/home/eugine/errbot-root/plugins/err-example/example.plug'  rejected by strategy 'SpecificBackendLocator'
16:44:02 DEBUG    errbot.specific_plugin_ma Load the one remaining...
16:44:02 DEBUG    errbot.specific_plugin_ma Class to load ShelfStoragePlugin
16:44:02 DEBUG    errbot.storage            Opening storage 'repomgr'
16:44:02 DEBUG    errbot.storage.shelf      Open shelf storage /home/eugine/errbot-root/data/repomgr.db
16:44:02 DEBUG    errbot.storage            Opening storage 'core'
16:44:02 DEBUG    errbot.storage.shelf      Open shelf storage /home/eugine/errbot-root/data/core.db

This is the output from typing "!status" in the private chat with the bot.

Yes I am alive...

    Plugins

┏━━━━━━━━┳━━━━━━━━━━━━━━━━┓ ┃ Status ┃ Name           ┃ ┡━━━━━━━━╇━━━━━━━━━━━━━━━━┩ │ A      │ ACLs           │ ├────────┼────────────────┤ │ A      │ Backup         │ ├────────┼────────────────┤ │ A      │ ChatRoom       │ ├────────┼────────────────┤ │ A      │ Flows          │ ├────────┼────────────────┤ │ A      │ Health         │ ├────────┼────────────────┤ │ A      │ Help           │ ├────────┼────────────────┤ │ A      │ Plugins        │ ├────────┼────────────────┤ │ A      │ Utils          │ ├────────┼────────────────┤ │ A      │ VersionChecker │ ├────────┼────────────────┤ │ C      │ Webserver      │ └────────┴────────────────┘ A = Activated, D = Deactivated, B = Blacklisted, C = Needs to be configured Load 0.02, 0.01, 0.0 GC 0->211 1->0 2->4

I have looked this question but it hasn't been very helpful.

Here is the code for helloworld.py

from errbot import BotPlugin, botcmd, arg_botcmd, webhook

class Helloworld(BotPlugin): """ Hello world and other testing and learning """

def activate(self):
    """
    Triggers on plugin activation

    You should delete it if you're not using it to override any default behaviour
    """
    super(Helloworld, self).activate()

def deactivate(self):
    """
    Triggers on plugin deactivation

    You should delete it if you're not using it to override any default behaviour
    """
    super(Helloworld, self).deactivate()

def get_configuration_template(self):
    """
    Defines the configuration structure this plugin supports

    You should delete it if your plugin doesn't use any configuration like this
    """
    return {'EXAMPLE_KEY_1': "Example value",
            'EXAMPLE_KEY_2': ["Example", "Value"]
           }

def check_configuration(self, configuration):
    """
    Triggers when the configuration is checked, shortly before activation

    Raise a errbot.utils.ValidationException in case of an error

    You should delete it if you're not using it to override any default behaviour
    """
    super(Helloworld, self).check_configuration(configuration)

def callback_connect(self):
    """
    Triggers when bot is connected

    You should delete it if you're not using it to override any default behaviour
    """
    pass

def callback_message(self, message):
    """
    Triggered for every received message that isn't coming from the bot itself

    You should delete it if you're not using it to override any default behaviour
    """
    pass

def callback_botmessage(self, message):
    """
    Triggered for every message that comes from the bot itself

    You should delete it if you're not using it to override any default behaviour
    """
    pass

@webhook
def example_webhook(self, incoming_request):
    """A webhook which simply returns 'Example'"""
    return "Example"

# Passing split_args_with=None will cause arguments to be split on any kind
# of whitespace, just like Python's split() does
@botcmd(split_args_with=None)
def example(self, message, args):
    """A command which simply returns 'Example'"""
    return "Example"

@arg_botcmd('name', type=str)
@arg_botcmd('--favorite-number', type=int, unpack_args=False)
def hello(self, message, args):
    """
    A command which says hello to someone.

    If you include --favorite-number, it will also tell you their
    favorite number.
    """
    return "Hello, " + format(msg.frm)

This is the code for helloworld.plug

[Core]
module = helloworld
name = Helloworld

[Documentation]
description = Hello world and other testing and learning

[Python]
version = 3

[Errbot]
min = 4.3.7
max = 4.3.7

These have been generated by using the command line errbot --new-plugin

Any pointers will be much appreciated!

0

There are 0 best solutions below