Skip to content

Instantly share code, notes, and snippets.

@luizcarvalho
Created November 3, 2018 21:06
Show Gist options
  • Save luizcarvalho/7156565d0c70c371bb395f60eceba2be to your computer and use it in GitHub Desktop.
Save luizcarvalho/7156565d0c70c371bb395f60eceba2be to your computer and use it in GitHub Desktop.
def handle_payloads
case current_message.payload
when 'MAIN_MENU'
step_to flow: 'hello', state: 'main_menu'
when 'DIRECTIONS'
step_to flow: 'informations', state: 'directions'
when 'GENERAL'
step_to flow: 'informations', state: 'general'
when 'MENU'
step_to flow: 'informations', state: 'menu'
else
step_to flow: 'hello', state: 'say_hello'
end
current_message.payload = nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment