wbrbr / hubot-xkcd

Get links to XKCD comics with Hubot
Do What The F*ck You Want To Public License
5 stars 4 forks source link

Question matteruser and hubot-xkcd #4

Open downright770 opened 7 years ago

downright770 commented 7 years ago

Hi, I'm new to this stuff and setup adapter matteruser for mattermost chat client. I've been able to create a shell script to get certain API to work. When trying to use the external script for hubot-xkcd in my chat room nothing happens. I've added to external scripts, restarted hubot but now lost on what to do. I've noticed open ticket with robot.http and tried that but didn't work. Any help would be amazing thank you.

jeffbyrnes commented 7 years ago

You need to add this module in two places:

Be sure to npm install to update the node modules locally & ensure they install without any difficulty.

The README needs to be updated to tell you to run npm install --save hubot-xkcd, it’s missing the --save argument which adds the entry to your Hubot instance’s package.json.

downright770 commented 7 years ago

npm install --save hubot-xkcd

External scripts [ "hubot-diagnostics", "hubot-help", "hubot-google-images", "hubot-google-translate", "hubot-pugme-reddit", "hubot-maps", "hubot-redis-brain", "hubot-rules", "hubot-shipit", "hubot-darksky", "hubot-gif", "hubot-time-me", "hubot-voting", "hubot-xkcd", "hubot-relevant-xkcd", "hubot-youtube", "hubot-hackernews" ]

ran cmd, doesn't do anything for me.

I have hubot setup running from a shell script.

jeffbyrnes commented 7 years ago

@downright770 is this the standard script that Hubot comes with when you generate one?

downright770 commented 7 years ago

Sorry new to alot of this. For the external scripts I've just been adding to it.

downright770 commented 7 years ago

or do you mean the shell script?

jeffbyrnes commented 7 years ago

I mean the shell script.

jeffbyrnes commented 7 years ago

I’m curious how you’re running Hubot; if it’s non-standard, something may be missing.

downright770 commented 7 years ago

!/bin/sh

export MATTERMOST_HOST=127.0.0.1 export MATTERMOST_WSS_PORT=8065 export MATTERMOST_HTTP_PORT=8065 export MATTERMOST_TLS_VERIFY=false export MATTERMOST_USE_TLS=false export MATTERMOST_USER=bot@.io export MATTERMOST_PASSWORD= export MATTERMOST_GROUP=int1 export MATTERMOST_LOG_LEVEL=debug

FOR HUBOT TO JOIN ALL PUBLIC CHANNELS

export MATTERMOST_ENDPOINT=bot/incoming export MATTERMOST_INCOME_URL=http://localhost:8065/int1/channels/jgq6ksc5hirbd87g1ag7qudujr__nnnkd53nci8kifu6jadccmmqwy export MATTERMOST_TOKEN=""

export HUBOT_DARK_SKY_API_KEY=

export HUBOT_WOLFRAM_APPID=""

export HUBOT_IMGUR_CLIENT_ID= export HUBOT_TIMEZONEDB_API_KEY= export HUBOT_GOOGLE_CSE_ID="" export HUBOT_GOOGLE_CSE_KEY="" export HUBOT_YOUTUBE_API_KEY=""

sleep 5min because we need to wait for MM to actually load and have no indicators

sleep 300

cd /home/chat/mybot bin/hubot --adapter matteruser #> /var/log/hubot.log 2>&1

jeffbyrnes commented 7 years ago

Well, I’ve not used matteruser, so I can’t speak to how their adaptor works. But that script should work well enough.

Do your other external scripts work?

downright770 commented 7 years ago

no other ones just the default stuff plus the exports in shell file.

jeffbyrnes commented 7 years ago

When I ask “do your other external scripts work?” I am referring to what you have in external-scripts.json.

So does the hubot-shipit module work? Or hubot-youtube? Or any of the others?

downright770 commented 7 years ago

yes they do, but only ones that i called in the shell script

downright770 commented 7 years ago

so "hubot-hackernews" doesn't work either

jeffbyrnes commented 7 years ago

If I understand you correctly, only the modules that require, and have set, an env var (such as HUBOT_YOUTUBE_API_KEY work correctly?

I should point out that there’s no reason for that; if a module doesn’t require any env vars to work properly (like hubot-xkcd or hubot-hackernews), then it should just work once it’s installed and added to external-scripts.json

Any chance you’re willing to share your entire hubot repo with me by inviting me as a collaborator?

downright770 commented 7 years ago

Is there away to share the repo not sure how to do that. sorry feel like a nobe

jeffbyrnes commented 7 years ago

See the docs on inviting collaborators to a personal repository

downright770 commented 7 years ago

Okay Sorry I don't have a repo

jeffbyrnes commented 7 years ago

Without being able to see all your code, I won’t be able to help any further. From what I can tell though, you’ve done everything right, so I’m at a loss.

downright770 commented 7 years ago

Do the external scripts need heroku (think thats what its called)

jeffbyrnes commented 7 years ago

@downright770 you might certainly try running your Hubot instance on Heroku, but they should work no matter where you are, esp. the ones that you trigger by messaging the bot itself.

downright770 commented 7 years ago

That's what I thought. Thanks for the help though hope to figure this out at some point

jeffbyrnes commented 7 years ago

Good luck!