Skip to main content

The engine for developing bots for soc. networks, instant messengers and other systems.

Project description

Kutana logo

Documentation Status Build Status CodeFactor Codacy Badge Coverage Status Codebeat Badge PyPI version

English | Русский

Kutana

The engine for developing bots for soc. networks, instant messengers and other systems.

Nice foundation for bot using kutana engine - kubot.

Installation

  • Download and install python (3.5.3+)
https://www.python.org/downloads/
  • Install kutana module (use python3 if needed)
python -m pip install kutana

Usage

  • Create Kutana engine and add managers.
  • Register your plugins in the executor. You can import plugin from folders with function load_plugins. Files should be a valid python modules with available plugin field with your plugin (Plugin).
  • Start engine.

Example run.py (token for VKManager is loaded from the file "configuration.json" and plugins are loaded from folder "plugins/")

from kutana import *

# Create engine
kutana = Kutana()

# Add VKManager to engine
kutana.add_manager(
    VKManager(
        load_value(
            "vk_token",
            "configuration.json"
        )
    )
)

# Load and register plugins
kutana.executor.register_plugins(
    load_plugins("plugins/")
)

# Run engine
kutana.run()

Example plugins/echo.py

from kutana import Plugin

plugin = Plugin(name="Echo")

@plugin.on_startswith_text("echo")
async def on_echo(message, env, body):
    await env.reply("{}".format(body))

Available managers

  • VKManager (for vk.com groups)
  • TGManager (for telegram.org)
    • document's type is named doc inside of engine.
    • TGAttachmentTemp is used for storing attachments before sending them with send_message or reply. Attachments can't be uploaded other way.
    • If you want to download file (attachment) from telegram, you have to use TGEnvironment.get_file_from_attachment.

Authors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kutana-2.1.3.tar.gz (25.0 kB view hashes)

Uploaded Source

Built Distribution

kutana-2.1.3-py3-none-any.whl (23.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page