This is a Google Hangouts Chat backend for Errbot.
-
Install errbot and follow to instructions to setup a
config.py
. -
Clone this repository somewhere convenient.
-
Install the requirements listed in
requirements.txt
.- If you meet some SSL issue, try it.
pip install -U pyOpenSSL cryptography
-
In Google Chat, create a bot that will represent ErrBot. If you need help with this step, check out this guide on Hangouts Chat bots based on Google Cloud Pub/Sub.
- Setup Google Chat API
-
Enable API
-
Manage > CONFIGURATION > Connection settings: Cloud Pub/Sub [Set the Topic Name]
-
Edit your ErrBot's
config.py
. Use the following template for a minimal configuration:import logging BACKEND = 'Hangoutschat' BOT_EXTRA_BACKEND_DIR = r'<path/to/errbot-backend-hangoutschat>' BOT_DATA_DIR = r'<path/to/your/errbot/data/directory>' BOT_EXTRA_PLUGIN_DIR = r'<path/to/your/errbot/plugin/directory>' BOT_LOG_FILE = r'<path/to/your/errbot/logfile.log>' BOT_LOG_LEVEL = logging.INFO BOT_IDENTITY = { 'project_id': '<projectid>', 'subscription_name': '<Subscription ID>', 'credentials_path': '<path/to/your/googleserviceaccount.json>' } BOT_ADMINS = ('<[email protected]>',) CHATROOM_PRESENCE = ()
Sections you need to edit are marked with
<>
. -
- Run as Daemon
errbot --daemon
-
Debug
Edit your ErrBot's
config.py
.BOT_LOG_LEVEL = logging.DEBUG
Run it with DEBUG log.
export GOOGLE_APPLICATION_CREDENTIALS='<path/to/your/googleserviceaccount.json>'; errbot
-
How to call bot
- DM
!tryme
- ROOM
@bot !tryme