@xurizaemon/hubot-matrix

3.0.2 • Public • Published

Hubot adapter for Matrix

This is a Hubot adapter for Matrix.

Installation

Use the following adapter based on your Hubot version (npm list hubot).

  • For Hubot v2, npm i hubot-matrix@1
  • For Hubot v3, npm i hubot-matrix@2
  • For Hubot v13+, npm i @xurizaemon/hubot-matrix

Adapter configuration

Set the following variables:

  • HUBOT_ADAPTER should be @xurizaemon/hubot-matrix
  • HUBOT_MATRIX_HOST_SERVER - the Matrix server to connect to (default is https://matrix.org if unset)
  • HUBOT_MATRIX_USER - bot login on the Matrix server - eg @examplebotname:matrix.example.org
  • HUBOT_MATRIX_PASSWORD - bot password on the Matrix server

Tests

To run tests in Github Actions, the following Github Secrets should be configured.

Name Example Description
TEST_MATRIX_URL https://matrix-client.matrix.org Home instance URL
TEST_MATRIX_ROOM !something:example.org Room ID (where to get it)
TEST_MATRIX_USER @someuser:example.org Username
TEST_MATRIX_PASSWORD ******** Password

There are environment variables which the tests need set to execute also. In Github Actions, these variables are set in the Github workflow configuration (.github/workflows/*.yml).

Name Example Description
HUBOT_MATRIX_HOST https://matrix-client.matrix.org Home instance URL
HUBOT_MATRIX_PASSWORD **** Test user a/c password.
HUBOT_MATRIX_USERNAME **** Test user a/c login.
HUBOT_FAREWELL_* Configure hubot-farewell1 Configure shutdown message
HUBOT_STARTUP_* Configure hubot-startup2 Configure startup message

Jest requires the experimental-vm-modules Node option to run .mjs tests:

NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" npm run test

Releasing

Will this work? We have an NPM and GPR publish workflow lol.

  1. Update version in package.json (and package-lock.json)
  2. Commit these changes
  3. Create a Git tag matching the version
  4. Push commits and tags
  5. Create a GitHub release based on the tag (which will trigger your workflow)
  1. https://github.com/xurizaemon/hubot-farewell/

  2. https://github.com/xurizaemon/hubot-startup/

Readme

Keywords

none

Package Sidebar

Install

npm i @xurizaemon/hubot-matrix

Weekly Downloads

1

Version

3.0.2

License

MIT

Unpacked Size

41 kB

Total Files

15

Last publish

Collaborators

  • xurizaemon