mmpy-bot-mk2


Namemmpy-bot-mk2 JSON
Version 2.1.6 PyPI version JSON
download
home_pagehttps://github.com/movax01h/mmpy_bot_mk2
SummaryA python based bot for Mattermost with its own webhook server.
upload_time2024-03-05 17:48:37
maintainer
docs_urlNone
authorAlex Tzonkov
requires_python>=3.8
licenseMIT
keywords chat bot mattermost
VCS
bugtrack_url
requirements aiohttp click mattermostautodriver schedule
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Forked from [attzonko/mmpy_bot](https://github.com/attzonko/mmpy_bot)


[![PyPI](https://badge.fury.io/py/mmpy-bot-mk2.svg)](https://pypi.org/project/mmpy-bot-mk2/)
[![Maintainability](https://api.codeclimate.com/v1/badges/809c8d66aea982d9e3da/maintainability)](https://codeclimate.com/github/movax01h/mmpy_bot_mk2/maintainability)
[![Python Support](https://img.shields.io/pypi/pyversions/mmpy-bot-mk2.svg)](https://pypi.org/project/mmpy-bot-mk2/)
[![Mattermost](https://img.shields.io/badge/mattermost-4.0+-blue.svg)](http://www.mattermost.org)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://pypi.org/project/mmpy-bot-mk2/)


Documentation available at [Read the Docs](https://mmpy-bot-mk2.readthedocs.org/).


## Description

A Python based chat bot framework for [Mattermost](http://www.mattermost.org). The code for
this bot framework was heavily re-factored in v2.0.0 and will only work with Python 3.8 or higher.
For Python 2 and Python3 < 3.8 support, please use versions v1.3.9 or lower.

## Features
- Based on Mattermost [WebSocket API(V4.0.0)](https://api.mattermost.com)
- Simple plugins mechanism
- Concurrent message handling
- Attachment support
- Auto-reconnect to Mattermost after connection loss

##### Additional features added in v2.x:
- Multi-threading and asyncio execution
- Integrated webhook server
- Support for click functions
- Job scheduling

## Compatibility

|    Mattermost    |  mmpy_bot_mk2   |
|------------------|:---------------:|
|     >= 4.0       |  > 1.2.0        |
|     <  4.0       | unsupported     |


## Installation
:warning: Warning: pip will grab v1.x if your Python version is less than 3.8!

##### v2.x (latest)
```
pip install mmpy-bot
```

##### v1.3.9 (force legacy)
```
pip install mmpy-bot==1.3.9
```

## Usage (v2.x)

### Registration

First you need to create a bot account on your Mattermost server.
Note: **Enable Bot Account Creation** must be enabled under System Console
1. Login to your Mattermost server as a user with Administrative privileges.
1. Navigate to Integrations -> Bot Accounts -> Add Bot Account
1. Fill in the configuration options and upon creation take note of the **Access Token**

Note that some API functions, such as ephemeral message replies, will require the bot to be part of the **System Admin** group,
however most API functions will work with a regular **Member** account role. Just be aware that if some API functions are not working, it
may be due to a lack of appropriate permissions.


### Configure and run the bot

Create an entrypoint file (or copy the one provided), that defines your Mattermost server and bot account settings and imports
the desired modules.

Example `my_bot.py`:

```python
#!/usr/bin/env python

from mmpy_bot_mk2 import Bot, Settings
from my_plugin import MyPlugin

bot = Bot(
    settings=Settings(
        MATTERMOST_URL = "http://chat.example.com",
        MATTERMOST_PORT = 443,
        BOT_TOKEN = "a69155mvlsobcnqpfdceqihaa",
        BOT_TEAM = "test",
        SSL_VERIFY = True,
    ),  # Either specify your settings here or as environment variables.
    plugins=[MyPlugin()],  # Add your own plugins here.
)
bot.run()
```

Set the executable bit on the entrypoint file (i.e. `chmod +x my_bot.py`) and start your bot from the command prompt. Now you can talk to your bot in your Mattermost client!

In order to get the most out of your bot, you will need to write your own plugins. Refer to the [Plugins Documentation](https://mmpy-bot-mk2.readthedocs.io/en/latest/plugins.html) to get started.

### Talk to us

The primary channel for communication is [GitHub](https://github.com/movax01h/mmpy_bot_mk2)
via [Issues](https://github.com/movax01h/mmpy_bot_mk2/issues)
or [Pull requests](https://github.com/movax01h/mmpy_bot_mk2/pulls)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/movax01h/mmpy_bot_mk2",
    "name": "mmpy-bot-mk2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "chat bot mattermost",
    "author": "Alex Tzonkov",
    "author_email": "anton.ohontsev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/44/1f/a5d8e153ee53907d2387693add57b3c5baceacc1e5ea670c6f048692018a/mmpy_bot_mk2-2.1.6.tar.gz",
    "platform": "Any",
    "description": "Forked from [attzonko/mmpy_bot](https://github.com/attzonko/mmpy_bot)\n\n\n[![PyPI](https://badge.fury.io/py/mmpy-bot-mk2.svg)](https://pypi.org/project/mmpy-bot-mk2/)\n[![Maintainability](https://api.codeclimate.com/v1/badges/809c8d66aea982d9e3da/maintainability)](https://codeclimate.com/github/movax01h/mmpy_bot_mk2/maintainability)\n[![Python Support](https://img.shields.io/pypi/pyversions/mmpy-bot-mk2.svg)](https://pypi.org/project/mmpy-bot-mk2/)\n[![Mattermost](https://img.shields.io/badge/mattermost-4.0+-blue.svg)](http://www.mattermost.org)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://pypi.org/project/mmpy-bot-mk2/)\n\n\nDocumentation available at [Read the Docs](https://mmpy-bot-mk2.readthedocs.org/).\n\n\n## Description\n\nA Python based chat bot framework for [Mattermost](http://www.mattermost.org). The code for\nthis bot framework was heavily re-factored in v2.0.0 and will only work with Python 3.8 or higher.\nFor Python 2 and Python3 < 3.8 support, please use versions v1.3.9 or lower.\n\n## Features\n- Based on Mattermost [WebSocket API(V4.0.0)](https://api.mattermost.com)\n- Simple plugins mechanism\n- Concurrent message handling\n- Attachment support\n- Auto-reconnect to Mattermost after connection loss\n\n##### Additional features added in v2.x:\n- Multi-threading and asyncio execution\n- Integrated webhook server\n- Support for click functions\n- Job scheduling\n\n## Compatibility\n\n|    Mattermost    |  mmpy_bot_mk2   |\n|------------------|:---------------:|\n|     >= 4.0       |  > 1.2.0        |\n|     <  4.0       | unsupported     |\n\n\n## Installation\n:warning: Warning: pip will grab v1.x if your Python version is less than 3.8!\n\n##### v2.x (latest)\n```\npip install mmpy-bot\n```\n\n##### v1.3.9 (force legacy)\n```\npip install mmpy-bot==1.3.9\n```\n\n## Usage (v2.x)\n\n### Registration\n\nFirst you need to create a bot account on your Mattermost server.\nNote: **Enable Bot Account Creation** must be enabled under System Console\n1. Login to your Mattermost server as a user with Administrative privileges.\n1. Navigate to Integrations -> Bot Accounts -> Add Bot Account\n1. Fill in the configuration options and upon creation take note of the **Access Token**\n\nNote that some API functions, such as ephemeral message replies, will require the bot to be part of the **System Admin** group,\nhowever most API functions will work with a regular **Member** account role. Just be aware that if some API functions are not working, it\nmay be due to a lack of appropriate permissions.\n\n\n### Configure and run the bot\n\nCreate an entrypoint file (or copy the one provided), that defines your Mattermost server and bot account settings and imports\nthe desired modules.\n\nExample `my_bot.py`:\n\n```python\n#!/usr/bin/env python\n\nfrom mmpy_bot_mk2 import Bot, Settings\nfrom my_plugin import MyPlugin\n\nbot = Bot(\n    settings=Settings(\n        MATTERMOST_URL = \"http://chat.example.com\",\n        MATTERMOST_PORT = 443,\n        BOT_TOKEN = \"a69155mvlsobcnqpfdceqihaa\",\n        BOT_TEAM = \"test\",\n        SSL_VERIFY = True,\n    ),  # Either specify your settings here or as environment variables.\n    plugins=[MyPlugin()],  # Add your own plugins here.\n)\nbot.run()\n```\n\nSet the executable bit on the entrypoint file (i.e. `chmod +x my_bot.py`) and start your bot from the command prompt. Now you can talk to your bot in your Mattermost client!\n\nIn order to get the most out of your bot, you will need to write your own plugins. Refer to the [Plugins Documentation](https://mmpy-bot-mk2.readthedocs.io/en/latest/plugins.html) to get started.\n\n### Talk to us\n\nThe primary channel for communication is [GitHub](https://github.com/movax01h/mmpy_bot_mk2)\nvia [Issues](https://github.com/movax01h/mmpy_bot_mk2/issues)\nor [Pull requests](https://github.com/movax01h/mmpy_bot_mk2/pulls)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python based bot for Mattermost with its own webhook server.",
    "version": "2.1.6",
    "project_urls": {
        "Homepage": "https://github.com/movax01h/mmpy_bot_mk2"
    },
    "split_keywords": [
        "chat",
        "bot",
        "mattermost"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aca503c705b3664644ea2c5aff058f32d2126bd1ac8d7b513593cc15f8e89e6d",
                "md5": "5414c258c96e2c784ec892970d055fb5",
                "sha256": "f61c074257deaeacd806e69e69a4865b50a373dc1b7181016d5fd9d2a118dfa7"
            },
            "downloads": -1,
            "filename": "mmpy_bot_mk2-2.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5414c258c96e2c784ec892970d055fb5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 31328,
            "upload_time": "2024-03-05T17:48:35",
            "upload_time_iso_8601": "2024-03-05T17:48:35.259972Z",
            "url": "https://files.pythonhosted.org/packages/ac/a5/03c705b3664644ea2c5aff058f32d2126bd1ac8d7b513593cc15f8e89e6d/mmpy_bot_mk2-2.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "441fa5d8e153ee53907d2387693add57b3c5baceacc1e5ea670c6f048692018a",
                "md5": "2fad2166f6d4ea7246436bd0b5ae7ad2",
                "sha256": "cfb4601fceb778f0252bb699068c3ba70e4157d7f778c8106c32518bc5520c7b"
            },
            "downloads": -1,
            "filename": "mmpy_bot_mk2-2.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "2fad2166f6d4ea7246436bd0b5ae7ad2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 27657,
            "upload_time": "2024-03-05T17:48:37",
            "upload_time_iso_8601": "2024-03-05T17:48:37.339462Z",
            "url": "https://files.pythonhosted.org/packages/44/1f/a5d8e153ee53907d2387693add57b3c5baceacc1e5ea670c6f048692018a/mmpy_bot_mk2-2.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-05 17:48:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "movax01h",
    "github_project": "mmpy_bot_mk2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiohttp",
            "specs": [
                [
                    ">=",
                    "3.7.4.post0"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    ">=",
                    "7.0"
                ]
            ]
        },
        {
            "name": "mattermostautodriver",
            "specs": [
                [
                    "~=",
                    "1.3.0"
                ]
            ]
        },
        {
            "name": "schedule",
            "specs": [
                [
                    ">=",
                    "0.6.0"
                ]
            ]
        }
    ],
    "lcname": "mmpy-bot-mk2"
}
        
Elapsed time: 0.19955s