Skip to content
David Mann edited this page Aug 29, 2016 · 13 revisions

Welcome to the fb-chatbot-framework-rails wiki!

!Work in progress!

You can find the Bot logic in lib/bot. Put your main Logic into bot_logic.rb - you can use different modules to speed up your bot development.

#MODULES

Reply Module

self.reply_message(msg, options={}) self.reply_image(img_url) self.reply_html(html) self.reply_bubble self.get_message

Emoji Module

Most of the time you will not need the Emoji Module because it is already integrated into the reply module.

This function will return the UTF-8 representation of the given Emoji Name

get_emoji(name)

This function will send a reply message with the UTF-8 representation of the given Emoji Name

reply_emoji(name)

This function will be always used with the reply_message function of the repy module. It will search for emoji names surrounded with : and replaces them with the UTF-8 representation of the given [Emoji Name]

compute_emojis(content)

This function is the opposite of the function above.

parse_emojis(content)

Web Search Module

With the web search module you can transport websites to messengers. Just add two methods to your bot logic. One for handling search requests and one for handling user input on the search results.

search_request_on_website(
	url: "http://www.example.com/",
	form_name: 'search',
	result_css_selector: '.result > a',
	image_css_selector: 'img'
)

handle_search_result(
	url: "http://www.example.com",
	result_css_selector: ".result"
)

State Machine Module

   #--> self.state_action
   #--> self.state_go
   #--> self.state_reset

Broadcast Module

   #--> self.handle_blacklist
   #--> self.broadcast_all
   #--> self.broadcast_list
   #--> self.offer_subscription
   #--> self.handle_subscription_response

User Roulette Module

   #--> self.roulette_message
   #--> self.handle_roulette_messege_response

Browser Module

   #--> self.
   #--> self.

CSV Lookup Module

   #--> Google Spreadsheet Lookup Module

Question Module

   #--> self.ask_questions
   #--> self.compute_answer
Clone this wiki locally