Add functions to buttons

How do I add functions to a button that shows up with slash command?
Was this page helpful?