mattermost-integration-giphy icon indicating copy to clipboard operation
mattermost-integration-giphy copied to clipboard

Suggestion: Let user select gif from a few samples

Open francisconoriega opened this issue 7 years ago • 13 comments

It would be really cool if there could be another command that would execute the search query, and privately show the calling user maybe 3 gifs generated by the giphy search. Users would then be able to use a follow up command to select one of the images and then that is posted in the chat room for everybody to see.

e.g workflow

/gifc cat

hidden message, only visible to user: Choose one with /gifc # 1)[gif-1]
2)[gif-2] 3)[gif-3] 4)try again 5)cancel

/gifc 2

public message

Giphy BOT user searched for cat [gif-2]

francisconoriega avatar Oct 31 '16 19:10 francisconoriega

Hello @bangoker,

Thanks for your suggestion. I agree, it's could be a great feature.

However, i guess it's hard to implement:

  • i dunno if it's possible on mattermost to send an hidden message.
  • this bot is a simple PING/PONG application (in this case, the bot should know the context of the first request to reply with the right gif). Maybe it's possible with the websocket API like https://github.com/LPgenerator/mattermost_bot.

Don't hesitate to give us technical solution if you can.

Thanks

Lujeni avatar Nov 03 '16 10:11 Lujeni

Hi @Lujeni,

seems to be possible at stewie bot. If you set an ! in between command and argument, its persistent, otherwise its just viewable for you.

https://github.com/nnewman/stewie

rkopplin avatar Dec 05 '16 12:12 rkopplin

Hi,

Could be great to add this functionality, but seems complicated for now. A feature idea is open on Mattermost forum to add some actions and buttons to webhooks (like Slack does).

pichouk avatar Apr 19 '17 09:04 pichouk

Hello Guys,

I made a proof of concept, that seem to work pretty well. For instance /gif show hello will prompt a sample of 5 relevent gif thumbnails only visible by you. By clicking on one of them, you made it visible for all.

mattermost_integration_pooc

Hope this can be used soon :) I'll try to release these changes next week.

rambobinator avatar Apr 21 '17 14:04 rambobinator

Wow really great ! What did you used to manage the "click to select" part ? Is that process client or server side ?

pichouk avatar Apr 21 '17 14:04 pichouk

Thumbnails are just links pointing to an internal endpoint, the tricky part was to handle redirection since referer is disable in mattermost links, so for now i just serve a javascript code that close the new tab ...

rambobinator avatar Apr 21 '17 14:04 rambobinator

Anything new on this ? Seems Mattermost wait for someone to implement action buttons for webhook (https://github.com/mattermost/platform/issues/6293), if anyone have Go and React skills ;)

pichouk avatar May 26 '17 21:05 pichouk

Hi folks !

The new Mattermost 4.2 version introduce Interactive Message Buttons feature. It seems to be what we are looking for :)

pichouk avatar Sep 22 '17 14:09 pichouk

Hey,

I tried to reimplement this using this new feature but since we still in 4.1, i can't test it for the moment. Do you know if buttons are customizable ?

rambobinator avatar Sep 24 '17 14:09 rambobinator

@rambobinator I'm not sure but I think you can't.

pichouk avatar Sep 25 '17 09:09 pichouk

@rambobinator https://demo.mattermost.com/login ;)

Lujeni avatar Oct 04 '17 14:10 Lujeni

@rambobinator could you make a PR with your proof of concept so other people can contribute to this feature?

erozqba avatar Jan 18 '18 15:01 erozqba

@erozqba Sure sorry about that, it was a long time ago and these new interactive message buttons don't really fit our needs for the moment (the message is visible by all). I won't PR that because it's ugly and i'm sure we can do better but you can check it out following this link: https://github.com/rambobinator/mattermost-integration-giphy/tree/issue_19

rambobinator avatar Jan 18 '18 16:01 rambobinator