Giter Club home page Giter Club logo

hubot-google-hangouts-chat's People

Contributors

dependabot[bot] avatar dgliu-f82 avatar googleworkspace-bot avatar jahilldev avatar joeyguerra avatar renovate[bot] avatar sqrrrl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hubot-google-hangouts-chat's Issues

is there a way to get hubot to listen to all messages in a room not just when @<botname> mentioned?

Reading #5 i'm confused if it will ever be possible for a bot to react to messages without its name mentioned.

Right now I can only seem to get messages sent with @ in a room - everything else is ignored. That makes log keeping and meeting notes bots and the likes hard to implement so i'm sure i'm missing something.

Reading https://developers.google.com/hangouts/chat/concepts/bots "Just like people, bots can participate in chat rooms, and they can respond to direct messages. But unlike people, bots only see messages directed to them when a person @mentions them in a chat room, or when a person sends them a direct message."

if the above is the hard limitation I guess I answered my own question and it is not possible with google hangouts to make a bot that can i.e. convert a #5 to a github link or have short cuts, like ".meet start" rather than "@meetbot meet start" or be able to make a bot that will help transcribe and archive content.

Are my observations correct and there are no way around this ?

Just use Hubot HTTP server

Don't need to start a duplicate express server. Just use Hubot's Express server.

    } else {
      // Begin listening at HTTP endpoint
// Replace startHttpServer
      this.startHttpServer();

// with this. That way, it can just use Hubot's HTTP server.
      this.robot.router.post('/', (req, res) => {
        this.onEventReceived(req.body, res);
      });
    }

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Rate Limited

These updates are currently rate limited. Click on a checkbox below to force their creation now.

  • Pin dependencies (chai, hubot, mocha)
  • Update dependency @google-cloud/pubsub to ^0.32.0
  • Update dependency chai to v4.3.6
  • Update dependency mocha to v6.2.3
  • Update dependency @google-cloud/pubsub to v3
  • Update dependency google-auth-library to v8
  • Update dependency googleapis to v104
  • Update dependency mocha to v10

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @google-cloud/pubsub ^0.29.1
  • body-parser ^1.18.2
  • express ^4.16.2
  • google-auth-library ^1.6.1
  • googleapis ^41.0.1
  • request ^2.87.0
  • chai ^4.2.0
  • hubot >=3.3.2
  • mocha ^6.1.4
  • hubot >=3.3.2

  • Check this box to trigger a request for Renovate to run again on this repository

Is this project maintained?

Hi,

we are migrating from slack to Google Chat and we have a couple of bots that we want to bring with us from Slack that are based on Hubot.

Is this project maintained and secure?

Error - False port in use

Hi,
I'm trying to run this app in docker and get the port in use error with any port I use. Please help
Here is my Dockerfile:

FROM node:latest

ENV DEBIAN_FRONTEND noninteractive
ENV HUBOT_NAME myhubot
ENV HUBOT_OWNER none
ENV HUBOT_DESCRIPTION Hubot
ENV EXTERNAL_SCRIPTS "hubot-help,hubot-pugme"

RUN useradd hubot -m

RUN npm install -g hubot coffeescript yo generator-hubot && \
    npm install --save hubot-google-hangouts-chat

USER hubot

WORKDIR /home/hubot

RUN yo hubot --owner="${HUBOT_OWNER}" --name="${HUBOT_NAME}" --description="${HUBOT_DESCRIPTION}" --defaults && sed -i /heroku/d ./external-scripts.json && sed -i /redis-brain/d ./external-scripts.json && npm install hubot-scripts --save

EXPOSE 8080

VOLUME ["/home/hubot/scripts"]

CMD node -e "console.log(JSON.stringify('$EXTERNAL_SCRIPTS'.split(',')))" > external-scripts.json && \
    npm install $(node -e "console.log('$EXTERNAL_SCRIPTS'.split(',').join(' '))") && \
    bin/hubot -n $HUBOT_NAME --adapter google-hangouts-chat

And here is the error I get while trying to the run the image created from above:

audited 178 packages in 1.277s
found 0 vulnerabilities

body-parser deprecated undefined extended: provide extended option node_modules/hubot/src/robot.js:445:21
[Mon Nov 19 2018 16:26:45 GMT+0000 (Coordinated Universal Time)] INFO Hangouts Chat adapter initialized successfully
[Mon Nov 19 2018 16:26:45 GMT+0000 (Coordinated Universal Time)] WARNING Loading scripts from hubot-scripts.json is deprecated and will be removed in 3.0 (github/hubot-scripts#1113) in favor of packages for each script.

Your hubot-scripts.json is empty, so you just need to remove it.
[Mon Nov 19 2018 16:26:45 GMT+0000 (Coordinated Universal Time)] INFO Server is running in port - 8080
[Mon Nov 19 2018 16:26:45 GMT+0000 (Coordinated Universal Time)] ERROR Error: listen EADDRINUSE: address already in use 0.0.0.0:8080
at Server.setupListenHandle [as _listen2] (net.js:1290:14)
at listenInCluster (net.js:1338:12)
at doListen (net.js:1469:7)
at process.internalTickCallback (internal/process/next_tick.js:72:19)

Package is not being published

Hi there,

Last night my PR was merged, but I've noticed the build is failing (and has been for sometime), I believe this is preventing your automation from publishing updated versions of this package.

Screenshot 2023-02-23 at 11 43 02

Could someone take a look for me?

Many thanks ๐Ÿ‘

How to run asynchronous queries via HTTP ? (where to set service accounts ?)

Hello

The adapter works pretty well for synchronous queries. But I am testing to use the robot.router.post method that allow asynchronous queries:

In exemple.coffee:

  robot.router.post '/hubot/chatsecrets/:room', (req, res) ->
    room   = req.params.room
    console.log req.body
    data   = req.body
    secret = data.secret

    robot.messageRoom room, "I have a secret: #{secret}"

    res.send 'OK'

And I have this result:

TypeError: Cannot read property 'thread' of undefined
  at HangoutsChatBot.sendMessage (/home/julien/web/hubot-google-hangouts-chat/src/bot.js:58:34)
  at HangoutsChatBot.send (/home/julien/web/hubot-google)hangouts-chat/src/bot.js:77:10)
  at Robot.messageRoom (/home/julien/web/myhubot/node_modules/hubot/src/robot.js:608:23)
  at /home/julien/web/myhubot/scripts/example.coffee:92:5, <js>:9:13

I assume that using HTTP mode we can only use today synchronous queries (it post data using httpRes sent in the message). Any option to have asynchronous ? :)

Help request: reply on same thread

Hello ๐Ÿ˜„
I could not find in the docs if it's possible to reply to a message in the same thread.
That would be ideal especially for multiple interactions.
Thanks

Hubot doesn't react on direct messages when talking directly to him with @myhubot

Hi all, I've been playing around with hubot integration of hangouts chat and is not working is said in the documentation, according to it, hubot should answer back on any mention as:

MYHUBOT help
myhubot help
@myhubot help
myhubot: help

but with google chat integration bot only reacts when it's mentioned with @ when it's mentioned twice, for example:

@myhubot myhubot help

after enabling DEBUG=true I've seen that in the received body is getting the raw message as text field but it's processing the field argumentedText which strips user's mention.

possible solution

I've made a small change on the HangoutsChatTextMessage object creation to use received message.text and then it works as expected, any reason why on the implementation the object is being created with argumentText? I haven't seen any difference but mentioned removed from the message.

raw json body of an example message with mention

...
        "text": "@myhubot help",
        "annotations": [
            {
                "type": "USER_MENTION",
                "startIndex": 0,
                "length": 8,
                "userMention": {
                    "user": {
                        "name": "users/USER-ID",
                        "displayName": "myhubot",
                        "avatarUrl": "https://lh4.googleusercontent.com/proxy/URL",
                        "type": "BOT"
                    },
                    "type": "MENTION"
                }
            }
        ],
        "thread": {
            "name": "spaces/THREAD-ID,
            "retentionSettings": {
                "state": "PERMANENT"
            }
        },
        "space": {
            "name": "spaces/SPACE-ID",
            "type": "ROOM",
            "displayName": "test-room"
        },
        "argumentText": " help"
...

Thanks!

Problem troubleshooting non responsiveness of hubot chatbot

Hi,
I'm trying to run hubot locally and configured it using gcp pub/sub adapter. I published my bot on hangout chat as well following this guide https://developers.google.com/hangouts/chat/how-tos/integrate-hubot

It shows up as green in chat (so I think it is connecting with my app), but I don't get any response back from the bot.
So, I tried getting logs from my docker container, where I'm running it. But, it doesn't contain any relevant information. This blocks me to do anything further. Any help is appreciated.

Here is my Dockerfile

FROM node:latest

ENV DEBIAN_FRONTEND=noninteractive \
    HUBOT_NAME=myhubot \
    HUBOT_OWNER=none \
    HUBOT_DESCRIPTION=Hubot \
    EXTERNAL_SCRIPTS="hubot-help,hubot-pugme" \
    PORT=8080 \
    EXPRESS_PORT=8081 \
    IS_PUBSUB=true \
    PUBSUB_PROJECT_ID='hubot-hangout-project' \
    PUBSUB_SUBSCRIPTION_ID='testsub' \
    GOOGLE_APPLICATION_CREDENTIALS='/home/hubot/cred/hubot-hangout-project-07a6200156ce.json'

RUN useradd hubot -m && \
    npm install -g hubot coffeescript yo generator-hubot && \
    npm install hubot-google-hangouts-chat

USER hubot

WORKDIR /home/hubot

RUN yo hubot --owner="${HUBOT_OWNER}" --name="${HUBOT_NAME}" --description="${HUBOT_DESCRIPTION}" --defaults && \
    sed -i /heroku/d ./external-scripts.json && \
    sed -i /redis-brain/d ./external-scripts.json && \
    npm install hubot-scripts --save && \
    node -e "console.log(JSON.stringify('$EXTERNAL_SCRIPTS'.split(',')))" > external-scripts.json && \
    npm install $(node -e "console.log('$EXTERNAL_SCRIPTS'.split(',').join(' '))")

EXPOSE 8080 8081

VOLUME ["/home/hubot/scripts"]

CMD bin/hubot -n $HUBOT_NAME --adapter google-hangouts-chat

And here are my logs

audited 178 packages in 1.296s
found 0 vulnerabilities

body-parser deprecated undefined extended: provide extended option node_modules/hubot/src/robot.js:445:21
[Fri Dec 07 2018 15:31:43 GMT+0000 (Coordinated Universal Time)] INFO Connecting to Pub/Sub subscription - projects/hubot-hangout-project/subscriptions/testsub
[Fri Dec 07 2018 15:31:43 GMT+0000 (Coordinated Universal Time)] INFO Hangouts Chat adapter initialized successfully
[Fri Dec 07 2018 15:31:43 GMT+0000 (Coordinated Universal Time)] WARNING Loading scripts from hubot-scripts.json is deprecated and will be removed in 3.0 (github/hubot-scripts#1113) in favor of packages for each script.

Your hubot-scripts.json is empty, so you just need to remove it.
(node:8) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead

Error: Maximum length of the field is 4096. Field: apps.dynamite.CreateMessageInfo.text_body

When users request help from the chatbot the Hangouts Chat API is erroring due to the length of the message being sent.

(node:74910) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:74910) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:74910) UnhandledPromiseRejectionWarning: Error: Maximum length of the field is 4096. Field: apps.dynamite.CreateMessageInfo.text_body
  at createError (/hubot/node_modules/axios/lib/core/createError.js:16:15)
  at settle (/hubot/node_modules/axios/lib/core/settle.js:18:12)
  at Unzip.handleStreamEnd (/hubot/node_modules/axios/lib/adapters/http.js:202:11)
  at Unzip.emit (events.js:208:15)
  at Unzip.EventEmitter.emit (domain.js:476:20)
  at endReadableNT (_stream_readable.js:1168:12)
  at processTicksAndRejections (internal/process/task_queues.js:77:11)

Depending on the content that may need to be sent the limitation of the Hangouts Chat API and how the adapter interacts with it could present a problem with sending appropriate responses.

[SyncRepoSettings bot] - Invalid config file

Failed to validate the config schema at '.github/sync-repo-settings.yaml': [
{
"instancePath": "/permissionRules/1/permission",
"schemaPath": "#/properties/permissionRules/items/properties/permission/enum",
"keyword": "enum",
"params": {
"allowedValues": [
"pull",
"push",
"admin"
]
},
"message": "must be equal to one of the allowed values"
}
]

Schema can be found at https://github.com/googleapis/repo-automation-bots/blob/main/packages/sync-repo-settings/src/schema.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.