Skip to main content

Mattermost plugin for elizaOS - Python implementation for bot integration

Project description

elizaos-plugin-mattermost (Python)

Python implementation of the Mattermost plugin for elizaOS.

Installation

pip install elizaos-plugin-mattermost

Quick Start

import asyncio
from elizaos_plugin_mattermost import MattermostConfig, MattermostService, MattermostContent

async def main():
    # Create config from environment variables
    config = MattermostConfig.from_env()
    
    # Or create config manually
    config = MattermostConfig(
        server_url="https://chat.example.com",
        bot_token="your-bot-token",
    )
    
    # Create and start service
    service = MattermostService(config)
    await service.start()
    
    # Register message handler
    def on_message(payload):
        print(f"Received message: {payload.post.message}")
    
    service.on_message(on_message)
    
    # Send a message
    content = MattermostContent(text="Hello from Python!")
    await service.send_message("channel_id", content)
    
    # Keep running
    try:
        while True:
            await asyncio.sleep(1)
    except KeyboardInterrupt:
        await service.stop()

asyncio.run(main())

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check .
ruff format .

License

MIT

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

elizaos_plugin_mattermost-2.0.0a4.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elizaos_plugin_mattermost-2.0.0a4-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file elizaos_plugin_mattermost-2.0.0a4.tar.gz.

File metadata

File hashes

Hashes for elizaos_plugin_mattermost-2.0.0a4.tar.gz
Algorithm Hash digest
SHA256 b5cc3aa0ff58d7791531bb78acc9be6836d0b55dc93a36caeed62440cceeba21
MD5 b0c5e4dcf348311ec45c410883f11d15
BLAKE2b-256 dc493bce11e604ad6070a4c78766f0feb8908c22ceb109b46ace88a601577bf6

See more details on using hashes here.

File details

Details for the file elizaos_plugin_mattermost-2.0.0a4-py3-none-any.whl.

File metadata

File hashes

Hashes for elizaos_plugin_mattermost-2.0.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 9b42bb7ce870220ce44d80e359562cca7eaad996c4ec7653215aa95167db3def
MD5 676d2083f5838d6d85465f261dee22ab
BLAKE2b-256 d4ca0bdc32919e1cb4a81e51b7ac9473ec1ad544b7d6c4fc2d4018f43f6ea9d1

See more details on using hashes here.

Supported by

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