Skip to content

Instantly share code, notes, and snippets.

View luizcarvalho's full-sized avatar
🟢
Dev and beer

Luiz Carvalho luizcarvalho

🟢
Dev and beer
View GitHub Profile
# directions.yml
- reply_type: text
text: |
Utilize nosso link de localização do Maps, com ele é fácil você chegar de qualquer lugar do mundo.
Localização: https://goo.gl/maps/AB2Bp7Uewct
- reply_type: text
text: |
Veja também o link do vídeo mostrando como chegar de carro até a entrada da cachoeira. =)
# (...)
flow :informations do
state :directions
state :general
state :menu
end
# (...)
class InformationsController < BotController
def directions
send_replies
end
def general
send_replies
end
- reply_type: text
text: Como posso te ajudar?
buttons:
- type: payload
text: 'Como chegar'
payload: 'DIRECTIONS'
- type: payload
text: 'Informações'
payload: 'GENERAL'
- type: payload
class BotController < Stealth::Controller
helper :all
def route
if current_message.payload.present?
handle_payloads
else
handle_messages
end
end
@luizcarvalho
luizcarvalho / say_hello.yml
Last active October 25, 2018 15:04
say_hello.yml
- reply_type: text
text: |
Olá! Que bom que entrou em contato.
Sou a assistente virtual da Cachoeira Esmeralda. Posso te auxiliar tirando alguma de suas dúvidas e te ajudando a encontrar nossa cachoeira.
buttons:
- type: payload
text: 'Começar'
payload: 'MAIN_MENU'
class HellosController < BotController
def say_hello
send_replies
end
def main_menu
send_replies
end
flow :hello do
state :say_hello
state :say_default_answer
state :main_menu
end
default: &default
# ==========================================
# ===== Example Facebook Service Setup =====
# ==========================================
facebook:
verify_token: <%= ENV['VERIFY_TOKEN'] %>
page_access_token: <%= ENV['FACEBOOK_PAGE_ACCESS_TOKEN'] %>
setup:
greeting: # Greetings are broken up by locale
- locale: default
- reply_type: text
text: Hello World!