- Quick shuffle the chat space members
- Unit Test (ready to TDD)
- No database needed
- Using google cloud task (AWS SQS equivalent)
- Shuffle from input
- Choose how many item will be showed (winner count)
- Random GPT, random anything using GPT prompt (e.g random number, quotes, places etc)
- Make the app configurable (need a DB)
- Scheduler (example use case: send daily quote or motivation to google chat space)
- Random based on input in mentioned message:
- Random member of current google chat space
- You can also get random quotes, motivation, number, places or anything else using this app
- Minimum NodeJS 16
- yarn (optional)
- Google Cloud project that enabled Cloud Function, Cloud Task, Google Chat API, etc or click here
- Google Workspace account
- Google Cloud CLI (how to install)
- run
yarn install
to install dependencies - run
yarn test
to make sure no failing of functionality - run
cp .env.yaml.examle .env.yaml
to copy .env.yaml.example to.env.yaml
- fill the value on
.env.yaml
file to correct config/environment - run
gcloud config set functions/region <your-region>
with the same region in.env.yaml
- run
yarn deploy
to deploy
- In Google Cloud Console, search for "Google Chat API" and click Google Chat API.
- Click
Manage
button. - Click Configuration and set up the Google Chat app:
- In App name, enter the app name (e.g RandomBot Custom).
- In Avatar URL, enter the logo(e.g https://developers.google.com/chat/images/quickstart-app-avatar.png) .
- In Description, enter the app description.
- Under Functionality, select Receive 1:1 messages, Join spaces and group conversations, and Log errors to Cloud Logging.
- Under Connection settings, select App URL and paste the URL for the Cloud Function trigger into the box.
- Under Permissions, select Specific people and groups in your domain and enter your email address.
- Click
Save
button. And done. You can use your app in google chat. Just search your app in "Find apps" menu