Created
March 14, 2017 21:08
-
-
Save makefunstuff/3f327f3a85ed2bd96c7d33608b4bb406 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :bot_setup do | |
desc 'Create get started button' | |
task get_started_button_create: :environment do | |
Facebook::Messenger::Thread.set({ | |
setting_type: 'call_to_actions', | |
thread_state: 'new_thread', | |
call_to_actions: [ | |
{ | |
payload: 'SETUP_BOT' | |
} | |
] | |
}, access_token: ENV['ACCESS_TOKEN']) | |
Rails.logger.info 'Get started button has been successfully set' | |
end | |
desc 'Create persistent menu' | |
task persistent_menu_create: :environment do | |
Facebook::Messenger::Thread.set({ | |
setting_type: 'call_to_actions', | |
thread_state: 'existing_thread', | |
call_to_actions: [ | |
{ | |
type: 'postback', | |
title: 'Reset settings', | |
payload: 'RESET' | |
} | |
] | |
}, access_token: ENV['ACCESS_TOKEN']) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment