{"id":19015119,"url":"https://github.com/adfinis/matterpy","last_synced_at":"2025-04-23T01:43:56.913Z","repository":{"id":68508363,"uuid":"66842417","full_name":"adfinis/matterpy","owner":"adfinis","description":"A very simple Mattermost bot written in Python","archived":false,"fork":false,"pushed_at":"2018-10-31T12:30:44.000Z","size":34,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-17T18:22:54.425Z","etag":null,"topics":["bot","chat","chatbot","mattermost","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adfinis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-29T12:39:22.000Z","updated_at":"2022-12-22T08:43:50.000Z","dependencies_parsed_at":"2023-03-11T03:46:11.935Z","dependency_job_id":null,"html_url":"https://github.com/adfinis/matterpy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adfinis%2Fmatterpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adfinis%2Fmatterpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adfinis%2Fmatterpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adfinis%2Fmatterpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adfinis","download_url":"https://codeload.github.com/adfinis/matterpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250354292,"owners_count":21416749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","chat","chatbot","mattermost","python"],"created_at":"2024-11-08T19:35:38.837Z","updated_at":"2025-04-23T01:43:56.897Z","avatar_url":"https://github.com/adfinis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Matterpy - A simple python mattermost bot\n\n![image](https://img.shields.io/github/license/adfinis-sygroup/matterpy.svg?maxAge=2592000)\n\nThis bot is purely based on python 3.5 asyncio. All functionality is\nprovided by plugins.\n\n## Configuration\n\nThe configuration is done via .ini file. There are several locations\nwhere matterpy looks for a configuration:\n\n  - /etc/matterpy.ini\n  - $HOME/config/matterpy/matterpy.ini\n  - matterpy.ini (local to where you start matterpy)\n\nAll those files are parsed (if they exist). If a specific config is not\nfound in one of them, then the next file is checked, and so on.\n\n## Deployment\n\nYou can just deploy the code as a python wheel package into a virtualenv\nor whatever. Alternateively, there's a Docker image on Dockerhub that\nyou can use. Just run it with the config file (see below) mounted into\n/code/matterpy.ini:\n\n```bash\ndocker run -ti --rm -v $PWD/matterpy.ini:/code/matterpy.ini adfinissygroup/matterpy\n```\n\n## Example config\n\nHere's an example configuration, which configures matterpy to enable\njust the \"echo\" plugin.\n\n```ini\n[DEFAULT]\nusername = matterpy\nport     = 8080\nhlost     = your-public-ip-address\n\n[channel testing]\nincoming = testing\noutgoing = https://your.mattermost.server/hooks/hook-identifier\n\n[plugin matterpy.contrib.echo]\n\nfilter = echo\n```\n\n## Plugins\n\nPlugins are configured by a `plugin` section in the config file. The\nname of the plugin should refer to a loadable / importable python\nmodule, which needs to define a single public function named `init()`.\nThis will be called upon startup.\n\nThe `init()` function will receive a `manager` object as well as it's\nconfiguration in a dict.\n\nYou can then call `manager.register(some_callback_function)` to get a\ncall each time you get an incoming message.\n\nThe callback function will receive the full mattermost message as a\ndict, and a `reply` (async) function as parameters. A simple echo plugin\ncould look like this:\n\n```python\n#!/usr/bin/env python3\n\n_conf = None\n\n\ndef init(manager, conf):\n    global _conf\n    _conf = conf\n    manager.register(handle_msg)\n\n\nasync def handle_msg(msg, reply):\n    text = msg['text']\n    text = text.replace(\"\\n\", \"\\n\u003e \")\n    await reply(\"Got your message:\\n\\n \u003e %s\\n\" % text)\n```\n\n### Echo Plugin\n\nReplies with a quote of what has just been said. Pretty useless, except\nfor testing and to show as an example. See above for the source :)\n\n### Redmine Plugin\n\nRedmine integration - Show issue details when an issue is mentioned.\n\nTrigger words are: \"redmine\\#1234\" or \"rm\\#1234\" (the hash sign is\noptional, spaces are allowd).\n\nThe configuration takes the following keys:\n\n```ini\n[plugin matterpy.contrib.redmine]\nredmine_username = api_username\nredmine_password = y0urp@ssw0rd\napi_key = oeruilsdfioauseroiusfsf\n\nurl     = https://base.url.of.your.redmine\n```\n\n### Jira Plugin (Experimental)\n\nUpon mention of a Jira issue (such as FOO-123), queries Jira and\ndisplays details about the given ticket.\n\nRequires the following config:\n\n```ini\n[plugin matterpy.contrib.jira]\n\nbase_url = http://url.to.your.jira\n\nauth = basic\n\nuser = jira_username\npass = jira_password\n```\n\nNote that this plugin is still WIP. I still need to convert the title\ninto a link and convert the description body from textile into markdown\n(or devise some other plan to handle it). Also, possibly tons of\nstabilisation etc.\n\n### Counter Plugin\n\nThis plugin is just a showcase for how to initialize a module\nasynchronously, and schedule periodic tasks (ie. does not react to user\ninput, but some other trigger).\n\n```ini\n[plugin matterpy.contrib.counter]\n\nstart_at = 1\nchannel = testing\n```\n\n### RSS Plugin\n\nAutomaticly posts RSS feeds on an set interval into a Mattermost chat of your choice.\n\nFor multiple RSS feeds add more of the shown blocks, the minimum is an RSS url and Mattermost channel name.\n\nInterval is optional and is configured in seconds, it sets how often it should check for updates in the feed.\n\nFormat is optional and with it you can custmize how the sent message will look like,\nyou can add any RSS element the feed has to it.\nIf you dont know what kind of elements your feed has let it fail once,\nby defining for example {foo} and it will show you all elements.\n\nExamples:\n\n```ini\n[plugin matterpy.contrib.rss]\n\nfeed.1.channel = channel_name\nfeed.1.url = https://url.to.rss.feed\nfeed.1.interval = 120\nfeed.1.format = {title}, {body}, {url}\n\nfeed.foo.channel = testing\nfeed.foo.url = http://url.to.rss.feed\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadfinis%2Fmatterpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadfinis%2Fmatterpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadfinis%2Fmatterpy/lists"}