Skip to content

RandomBot - shuffle the member of google chat space and also anything

License

Notifications You must be signed in to change notification settings

dyaskur/google-chat-shuffler

Repository files navigation

Google Chat RandomBot

Chat app that can be used to random google chat space member or anything else

StyleCI Github Action Scrutinizer Quality Score Coverage Status Quality Gate Status Reliability Rating Maintainability Rating Security Rating Duplicated Lines (%) Vulnerabilities Technical Debt Lines of Code

Features:

  • 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)

Roadmap:

  • Make the app configurable (need a DB)
  • Scheduler (example use case: send daily quote or motivation to google chat space)

Screenshot:

  • Random based on input in mentioned message:
    • screenshot.gif
  • Random member of current google chat space
    • screenshot2.png
  • You can also get random quotes, motivation, number, places or anything else using this app
    • screenshot1.png

Prerequisites:

  • 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)

How to install/deploy:

  • 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

How to setup google chat app:

  • 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