Skip to content
Automatic responses for Google Chat and Hangouts.
Python HTML Nix Other
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ansible fix deploy restarts Dec 30, 2019
gchatautorespond set up standalone bot for gmail smtp May 11, 2020
nix accept acme terms Feb 23, 2020
secrets transcrypt 2.0.0; reconfigure repo Aug 24, 2019
test patch out WorkerIPC Aug 19, 2016
.dockerignore deploy app with docker Dec 30, 2019
.gitattributes transcrypt 2.0.0; reconfigure repo Aug 24, 2019
.gitignore deploy app with docker Dec 30, 2019
CONTRIBUTING.md add licensing code Oct 1, 2016
Dockerfile deploy app with docker Dec 30, 2019
LICENSE Initial commit Oct 18, 2015
Makefile add local actions to makefile Jan 17, 2020
README.md set up standalone bot for gmail smtp May 11, 2020
ansible.cfg reorganize supervisor logs Sep 2, 2016
delete_old_mail.py raven -> sentry-sdk Jul 22, 2019
dev-requirements.in django 2.2 compat Feb 23, 2020
dev-requirements.txt upgrade djmail and sentry-sdk Feb 23, 2020
manage.py deploy app with docker Dec 30, 2019
reenable_bots.py raven -> sentry-sdk Jul 22, 2019
requirements.in django 2.2 compat Feb 23, 2020
requirements.txt upgrade djmail and sentry-sdk Feb 23, 2020
respond_icon.svg add respond icon + attribution link Jul 7, 2018
run_testworker.py raven -> sentry-sdk Jul 22, 2019
run_worker.py raven -> sentry-sdk Jul 22, 2019
send_admin_email.py notify on backup failures Oct 16, 2018
standalone_bot.py disconnect standalone on failed_auth May 11, 2020
standalone_oauth.json add web oauth flow for standalone bot [closes #6] Oct 6, 2016
sync_licenses.py raven -> sentry-sdk Jul 22, 2019
test_requirements.txt upgrade gevent; refactor requirement files Aug 28, 2016

README.md

Autoresponder for Google Chat and Hangouts

Autoresponder is a Django project that hosts static Google Chat/Hangouts bots.

I originally created it to avoid unnoticed messages to my forwarding accounts, but it's also found use with employees and small business owners.

The hosted version is available at https://gchat.simon.codes.

self-hosting

Autoresponder can also be self-hosted.

First, install the dependencies and connect your account:

$ pip install -r requirements.txt
$ python standalone_bot.py auth

You only need to run this once. The OAuth credentials will be written to your current working directory.

Then, start the bot:

$ python standalone_bot.py run my-email@gmail.com 'my autoresponse'

To further customize your bot, modify the constructor params for StandaloneBot at the bottom of standalone_bot.py (the arguments are documented in lib.chatworker.bot.AutoRespondBot).

email notifications

Email notifications are not enabled by default. To enable them you must configure gchatautorespond/settings_standalone.py to use your mail server. Gmail SMTP values are provided as an example; to use it, set DJ_EMAIL_HOST_USER to your gmail address and DJ_EMAIL_HOST_PASSWORD to your password (or app password) as environment variables. Then, verify your configuration with:

DJANGO_SETTINGS_MODULE=gchatautorespond.settings_standalone python manage.py sendtestemail from@example.com to@example.com

Once email sending is configured, you can enable autoresponses with notifications by running:

$ python standalone_bot.py notify my-email@gmail.com 'my autoresponse'

Or, you can just send notifications without responses with:

$ python standalone_bot.py notify my-email@gmail.com

In either case, notifications are sent from your DJ_EMAIL_HOST_USER to your provided email. You can control the recipient email by changing the notify_email parameter to StandaloneBot.

project layout

  • ansible: deployments
  • gchatautorespond/apps/autorespond: main django app
  • gchatautorespond/lib/chatworker: manages chat bots
  • nix: infra/config management
  • secrets: prod secrets (managed with transcypt)
You can’t perform that action at this time.