Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CONTRIBUTING.md to provide a more involved example of creating a command #32

Open
ishu3101 opened this issue Apr 7, 2016 · 1 comment

Comments

@ishu3101
Copy link

ishu3101 commented Apr 7, 2016

How do you create your own slash command? How do you get the slash command to do more than just open a new tab which is what is shown in the example given in the documentation here.

I would like to create a /google command that would search the web with google and get the url and title of the search result the user selected and insert it into the textarea.

@jessepollak
Copy link
Owner

Hi! Thanks for the feedback. I will work to improve the documentation with a more full-fledged example. In the meantime, here are some good places to start:

  • Check out the implementation for the /giphy command here. Probably the biggest thing to see there is how we use the Container component (source here) to contain the search. This adds in all of the default UI you see in /giphy, /spotify, /emoji.
  • Check out the Search component here. For the simplest implementation, you can use the Search.Widget component, which requires the props specified here. If you'd like to do something a little more involved, you can look to Emoji uses Search.Input and then does a custom rendering.

If you'd like to dive in, I can make myself available here to answer any questions you have getting set up!

@jessepollak jessepollak changed the title How to create your own slash command Update CONTRIBUTING.md to provide a more involved example of creating a command Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants