Go to file
Sharon Kennedy 139aa3a377 v3.1.0 2022-01-12 12:09:01 -05:00
__mocks__ add test for bot signal 2020-09-06 13:39:39 -04:00
dist add bot command for bug reports 2022-01-12 12:05:19 -05:00
src add bot command for bug reports 2022-01-12 12:05:19 -05:00
transcripts keep transcripts out of git 2020-04-22 18:06:01 -04:00
.gitignore fetch and use admin settings 2020-11-30 22:47:32 -05:00
Dockerfile add timezone to dockerfile 2020-09-08 10:41:29 -04:00
README.md Update README.md 2021-12-20 14:24:18 -05:00
package.json v3.1.0 2022-01-12 12:09:01 -05:00
sample.config.json remove encryption config 2020-12-01 13:25:06 -05:00
webpack.config.js remove references to client 2020-05-06 20:49:14 -04:00
yarn.lock fetch and use admin settings 2020-11-30 22:47:32 -05:00

README.md

Safe Support Chat Bot

A simple Matrix bot that handles inviting, uninviting, and notifying Riot users on the recieving end of the Safe Support chatbox.

The bot configuration file is config.json. It can also pull in user-set configurations from the Safe Support Chat Admin app. To do so, run the command yarn setup before starting the bot.

What does the bot do?

  • The bot receives an invitation to every chatroom created by the embedded chatbox, and automatically accepts
  • Upon joining a new room, the bot invites all of the members of the Facilitators community
  • When the first facilitator accepts the invitation, the bot uninvites the rest of the facilitators
  • The bot notifies the Support Chat Notifications chatroom when there is a support request and when a facilitator joins
  • If there are no facilitators online, the bot notifies the support seeker
  • The bot makes the facilitator a moderator of the chatroom so they can change the room settings (i.e. room name)
  • The bot listens to all the incoming messages and prints them to a transcript if that setting is enabled (CAPTURE_TRANSCRIPT)
  • Messages that start with !bot are treated as commands.
  • The bot sends a notification to the support chatroom and the Support Chat Notifications room if it crashes
  • On startup, the bot deletes all of the old device IDs for its account

Bot commands

Command Response
!bot hi Bot responds with a greeting
!bot transcript Bot sends the chat transcript as a .txt file
!bot transcript please Bot happily sends the transcript :)

Local development

If you prefer to develop locally instead of on Glitch:

Clone the project

git clone https://github.com/Safe-Support-Chat/ocrcc-bot.git

Install dependencies

cd safesupport-bot
yarn

Copy the sample config file and add in the missing values.

cp sample.config.json config.json

Pull in the user-defined settings (if there are any).

yarn setup

Start the local server

yarn develop

Run the tests

yarn test

Production build

yarn build