mattermost/mattermost-integration-giphy

Making this work with multiple channels and hubot

devTechi opened this issue · 4 comments

Hello,

first of all thanks for this.

In order to work with hubot at the same time we need to change some environment variables, at least I did.
I changed yours to the following

MATTERMOST_TOKEN to MATTERMOST_GIPHY_TOKEN (and of course everywhere it is used)

and

port = int(os.environ.get('PORT', 5000)) to port = int(os.environ.get('GIPHYPORT', 5000))

To support multiple channels I changed the line if data['token'] != MATTERMOST_GIPHY_TOKEN: to MATTERMOST_GIPHY_TOKEN.find(data['token']) == -1:

After that you just need to create an outgoing webhook for every channel in every team and put it (perhaps comma separated) to your environment variable.

Works fine that way.

P.s.: for security reasons I changed the line app.run(host='0.0.0.0', port=port) to app.run(host='127.0.0.1', port=port)

Thanks @devTechi ! This is useful information. If you'd like to submit a PR to fix some or all of that I'd gladly accept it.

Ok. Will see if I can do it tomorrow.

@jwilander I've got an OT question concerning the Android app in development. Is it possible for me to test it? Or where should I ask for that? Thx 😊

Hello,

After that you just need to create an outgoing webhook for every channel in every team and put it (perhaps comma separated) to your environment variable.

You should use a slash command (it's cross channels).
Our fork support this feature: numberly#1

Regard