Acrobot is a Google Hangouts chat bot, with the aim of keeping track of acronyms within the company.
Acrobot is capable of multiple actions:
- Saving acronym:
!acronym = explanation
- Getting an acronym explanation:
- Modifying acronym explanation:
!acronym = explanation => new explanation
- Removing acronym explanation:
!acronym = explanation =>
White spaces do not matter. If you are interacting with acrobot in a room,
do not forget to tag the bot, e.g.
@Acrobot !acronym = explanation.
You can change and remove only those explanations that you entered into the database.
Acrobot is a simple application, using:
- Java (tested against OpenJDK 1.8 and OpenJDK 11)
- Kubernetes/OpenShift for deployment #todo OCP template
This particular implementation uses Google's Cloud Pub/Sub messaging middleware.
custom_mark10 @startuml; actor "Google Hangouts" as User; participant "Pub/Sub middleware" as A; participant Acrobot; User -> A: Send a message; Acrobot --> A: Poll for a message; Acrobot --> User: Send a response; @enduml; custom_mark10
As such, before deploying the Google bot, you have to complete Google's Pub/Sub prerequisites:
- Create a project in the Cloud Platform Console, which:
- Has the Pub/Sub API enabled.
- Has granted the Pub/Sub permissions to the firstname.lastname@example.org service role.
- Create a service account with the Pub/Sub API roles.
- Create a message queue in the Cloud Platform Console.
- Associate the queue with a subscription in the Cloud Platform Console.
For more details on setting up the bot, see the Google Developer's documentation.
Acrobot has a few dependencies:
- export GOOGLE_APPLICATION_CREDENTIALS: an environment variable that contains the path to the service account json you created. If you are deploying Acrobot on Kubernetes/OpenShift, you will have to inject the file either using a secret, or a config map, into your pod.
- export JDBC_URL, JDBC_USER, and JDBC_PASSWORD for the DB connection details.
- export PROJECT_ID and SUBSCRIPTION_ID which match your Google project and subscription created earlier.
Author: Marek Czernek. The idea of Acrobot came from a number of very smart folks at Red Hat. The IRC implementation was done by https://github.com/mfojtik. If you wish to run AcroBot on IRC, see the AcroBot Implementation.