athieriot / hubot-yammer

This is the Yammer adapter for hubot that allows you to send a message to him with Yammer and he will happily reply the same way.
31 stars 26 forks source link

Yammer Integration With Hubot #28

Open learnTech2022 opened 7 years ago

learnTech2022 commented 7 years ago

Hi, I am new to the hubot and want to integrate my hubot with yammer, Can u please tell me the procedure step by step. I know their are adoptors available for that purpose, but i dont know how to use adaptors to talk to hubot from yammer.

Thanks, Krishna P

athieriot commented 7 years ago

Hi @krishna1990fis

Have you look at the Readme? It explains more in details how to setup Hubot: https://github.com/athieriot/hubot-yammer

learnTech2022 commented 7 years ago

Hi @athieriot

Thanks for your reply, currently i have hubot running locally in my machine and i am able to have the communication with hubot from command prompt after starting hubot from bin\hubot

Now for yammer integration i have done following things.

  1. npm install -a yammer -n name (as mentioned in README.md file on github/hubot-yammer) as shown below image

  2. For yammer account and token

    1. i already had yammer account in my organisation
    2. i signed in with that account
    3. i registered an API application https://www.yammer.com/client_applications
    4. i have got the token for the same and replaced below % export HUBOT_YAMMER_ACCESS_TOKEN="my new token"
  3. i created one public group in the yammer

since my hubot is in my local machine, i have set NON-HEROKU Environment Variable % export HUBOT_YAMMER_ACCESS_TOKEN="access_token" % export HUBOT_YAMMER_GROUPS="groups list" and have place both in bin\hubot

with all above setup, im still not able to get reply from the hubot when i post some questions in yammer public group. image

Please reply if i have missed out some configuration.

Thanks a lot, Krishna

athieriot commented 7 years ago

I think the README mention that the launch command is:

  bin/hubot -a yammer -n name

And it is seperated from installing stuff using npm.

Have you tried that one?

learnTech2022 commented 7 years ago

@athieriot

Also i have copied yammer.coffee script inside script folder of myhubot.

athieriot commented 7 years ago

This should not be necessary and will be available when doing

 npm install hubot-yammer

What does return: bin/hubot -a yammer -n name?

learnTech2022 commented 7 years ago

Yes i have tried that way, but it will through an error image

bin\hubot is the place where hubot interface would be, once we enter bin\hubot, hubot CLI will start and user can post a questions der to hubot.

How are we adding an adoptor to hubot here ? is it by running the above command successfully ? Please clarify.

athieriot commented 7 years ago

I'm sorry but it looks like it doesn't even start hubot. Both your commands ends not finding hubot at all

learnTech2022 commented 7 years ago

where should i run this command, in my user account or inside hubot directory.

1.when i run this from my user account in command prompt, it gives me error as mentioned in above comment

  1. when i run the sam command after entering inside the hubot directory, it gives bin is not recognized error
learnTech2022 commented 7 years ago

to find hubot we need to enter into the hubot directory and start hubot by typing bin\hubot command

learnTech2022 commented 7 years ago

@athieriot

i think i have figured out how to run the command. and now im getting this error image

[Thu Dec 22 2016 20:03:46 GMT+0530 (India Standard Time)] ERROR Cannot load adapter yammer - SyntaxError: unexpected IDENTIFIER

athieriot commented 7 years ago

Ah ok that's better. So know that the -n arguments is just the name of the bot. Nothing to do with Yammer

And now you probably need to export HUBOT_YAMMER_ACCESS_TOKEN again.

learnTech2022 commented 7 years ago

I generated hubot yammer access token again, but now i am getting following error image

Particularly this one is causing the issue, [Thu Dec 22 2016 21:20:58 GMT+0530 (India Standard Time)] ERROR hubot-heroku-alive included, but missing HUBOT_HEROKU_KEEPALIVE_URL. heroku config:set HUBOT_HEROKU_KEEPALIVE_URL=$(heroku apps:info -s | grep web-url | cut -d= -f2)

and this

[Thu Dec 22 2016 21:20:58 GMT+0530 (India Standard Time)] ERROR Error: listen EADDRINUSE 0.0.0.0:8080

learnTech2022 commented 7 years ago

how to get rid of heroku stuff here, all of a sudden this got popped up. i even tried deleting this from the node-module. But it again created after running the above command.

athieriot commented 7 years ago

The last error means you already have another service running on port 8080 and so something that tries to run it fails. Can it has to do with listener.coffee?

As I am guessing you are not publishing on heroku at the moment but running on your computer, you will need to export the environment variable requested (With a dummy) not to have the error.

I never use hubot heroku keepalive so I won't be super useful with it I'm afraid

learnTech2022 commented 7 years ago

last error somehow disappeared, but the second one is still their. Yes you are ritte, im not deploying on heroku, its in my local machine. I even tried exporting the environment variable requested like this export HUBOT_HEROKU_KEEPALIVE_URL=$(heroku apps:info -s | grep web-url | cut -d= -f2) But it dint work !

I think one last step im struck.

athieriot commented 7 years ago

You can't just use this command line on your computer if you don't have the heroku tool belt installed. Try using any other value. Like literally anything. "blabla"

learnTech2022 commented 7 years ago

i tried giving some random value, but its not going (export HUBOT_HEROKU_KEEPALIVE_URL="aaaaaaaa") Anyway its late i will look into it tomorrow.

I thank you very much for helping me out with the setup, thank you so much once again. Bye now Take care Have a good day !

Krishna P

learnTech2022 commented 7 years ago

@athieriot Now i am able to get rid of above mentioned error. i have removed hubot heroku using npm uninstall command for time being.

image

what next ? it is not doing anything, how do i proceed now ? Do i need to post some message in the yammer public group i have created ? Please suggest.

Thank you Krishna P

athieriot commented 7 years ago

Good news. So normally, Hubot should now respond in the "chatbot_Hubot" group in Yammer.

I believe that it will answer to the name you passed as "-n" argument. (I would advice you to use a simpler name ^^)

So could you try:

  Krishna.Pujar@fisglobal.com help

Or

  hubot help
learnTech2022 commented 7 years ago

@athieriot Hi,

After following all the steps properly, i am still not able to communicate with the hubot from yammer group.

Let me list the steps i have done so far.

  1. I have a account in yammer by my official email id, and have created a saparate group for hubot communication which is public.
  2. Access token for hubot from yammer

  1. before that i ran npm install hubot-adopter and it was successfull after which i got hubot-yammer folder in node_modules folder of myhubot
  2. then i executed this command bin\hubot -a yammer -n krishnapujar
  3. then i went to yammer and loged in with my account and typed krishnapujar help in a group which i created for chatbot as chatbot_Hubot

Did i miss out something ? Please write back

Thank You Krishna