Example #1
0
    async def setup(self, _conv_list):
        """async init part of the handler

        Args:
            _conv_list: hangups.conversation.ConversationList instance
        """
        await plugins.tracking.start({
            "module": "handlers",
            "module.path": "handlers"
        })

        plugins.register_shared("reprocessor.attach_reprocessor",
                                self.attach_reprocessor)

        plugins.register_shared("chatbridge.behaviours", {})

        self._reprocessors.start()
        self._contexts.start()
        self._image_ids.start()
        self._executables.start()

        plugins.tracking.end()

        _conv_list.on_event.add_observer(self._handle_event)
        _conv_list.on_typing.add_observer(self._handle_status_change)
        _conv_list.on_watermark_notification.add_observer(
            self._handle_status_change)
Example #2
0
def _initialise(bot):
    utils._conversation_list_cache = convmem # !!!: it works, but i don't like it ;P
    _memory_load(bot)
    _update_conversation_list(bot)
    plugins.register_admin_command(["dumpconv"])
    plugins.register_handler(_watch_message, type="allmessages")
    plugins.register_handler(_watch_rename, type="rename")
    plugins.register_handler(_watch_member, type="membership")
    plugins.register_shared('convmem.removeconv', _conv_remove)
Example #3
0
def _initialise(bot):
    """register the commands and help, shareds on the aliases

    Args:
        bot: HangupsBot instance
    """
    bot.memory.validate({'hoalias': {}})

    plugins.register_user_command(['gethoalias'])
    plugins.register_admin_command(['sethoalias'])
    plugins.register_help(HELP)

    plugins.register_shared('convid2alias', functools.partial(get_alias, bot))
    plugins.register_shared('alias2convid', functools.partial(get_convid, bot))
Example #4
0
def _initialise(bot):
    _externals["bot"] = bot
    plugins.register_shared('image_validate_link', image_validate_link)
    plugins.register_shared('image_upload_single', image_upload_single)
    plugins.register_shared('image_upload_raw', image_upload_raw)
    plugins.register_shared('image_validate_and_upload_single',
                            image_validate_and_upload_single)
Example #5
0
def _initialise(bot):
    _migrate_dnd_config_to_memory(bot)
    _reuseable = functools.partial(_user_has_dnd, bot)
    functools.update_wrapper(_reuseable, _user_has_dnd)
    plugins.register_shared('dnd.user_check', _reuseable)
    plugins.register_user_command(["dnd"])
Example #6
0
def _initialise(bot):
    _reuseable = functools.partial(_user_has_dnd, bot)
    functools.update_wrapper(_reuseable, _user_has_dnd)
    plugins.register_shared('dnd.user_check', _reuseable)
    plugins.register_user_command(["dnd"])
Example #7
0
def _initialise(bot):
    _externals["bot"] = bot
    plugins.register_shared('image_validate_link', image_validate_link)
    plugins.register_shared('image_upload_single', image_upload_single)
    plugins.register_shared('image_upload_raw', image_upload_raw)
    plugins.register_shared('image_validate_and_upload_single', image_validate_and_upload_single)