Skip to main content

A Matrix chat bot

Project description

chaanbot

A python 3 matrix bot using matrix-python-sdk. The bot is extensible and currently provides:

  • Highlight module allows users to easily notify groups of users. E.g. "!hl javadevs spring-boot vs micronaut?" would highlight/notify any user in the javadevs group.
  • Weather module allows users to broadcast weather reports.
  • More to come!

Bot is under active development and severe breaking changes should be expected until a stable release is created.

Install instructions

Chaanbot requires Python 3.

Add user for bot. Not required but recommended:

sudo adduser --disabled-password chaanbot
sudo su chaanbot

Create virtual environment and install bot and its dependencies:

python3 -m venv chaanbot
source chaanbot/bin/activate
python3 -m pip install chaanbot

Start bot to initialize config file creation, then edit the config file to your liking. Config file location is the user's config directory as determined by appdirs, typical locations are:

    Mac OS X:  ~/Library/Application Support/chaanbot/chaanbot.cfg
    Unix:      ~/.config/chaanbot/chaanbot.cfg or in $XDG_CONFIG_HOME, if defined
    Win *:     C:\Users\<username>\AppData\[local or roaming]\chaanbot\chaanbot\chaanbot.cfg

Output of running the bot will also show where the config file is located:

chaanbot
nano .config/chaanbot/chaanbot.cfg

Bot should now be runnable as chaanbot user:

chaanbot

For convenience bot can be added as service. With sudo access, copy chaanbot.service file to /etc/systemd/system/chaanbot.service:

sudo nano /etc/systemd/system/chaanbot.service

Bot is now startable from systemctl:

sudo service chaanbot start

And can be set to run on boot:

sudo systemctl enable chaanbot

Upgrading version

Upgrading from 1.x to 2.0

In 2.0 access token login is (hopefully temporarily) disabled, use password login instead. See chaanbot.cfg.sample for how to set password.

Commands

sudo su chaanbot
source /home/chaanbot/chaanbot/bin/activate
python3 -m pip install -U chaanbot

TODO

Core

  • Improve error handling
  • Integration tests and better test coverage
  • Improve installation documentation for non-Ubuntu installations

Modules

  • Make weather coordinates not room-dependent

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

chaanbot-3.1.1.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

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

chaanbot-3.1.1-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file chaanbot-3.1.1.tar.gz.

File metadata

  • Download URL: chaanbot-3.1.1.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/62.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for chaanbot-3.1.1.tar.gz
Algorithm Hash digest
SHA256 29c3d823dc20bc53d30913dcae20d648b5b349208878590f73cfe46a298c29b7
MD5 86c7cfbc5af28c9802f7afa4dd46448b
BLAKE2b-256 63d1f0b3b0a442b5bd549786a5970714fd75d941e617f2da3432f5cac8474210

See more details on using hashes here.

File details

Details for the file chaanbot-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: chaanbot-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/62.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for chaanbot-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 efc8d2dbaadd73fe1a4303e72ef4f4f6aac368e616e226c7b255dace10ca9ba6
MD5 826e5744e68f2869051aa2fcfa32a986
BLAKE2b-256 de6348697c881d75a7e1359aaa8d47d1647b2c9829b25d92043b20d75a902947

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