Code Monkey home page Code Monkey logo

botstack's People

Contributors

davidmann4 avatar hola-soy-milk avatar mraaroncruz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botstack's Issues

Provide dummy TOS/Privacy Policy for fb app review

It would be nice if we would provide a tos.html file which provides a basic tos for the bot app used for the bot service ( fb app review) I guess this tos is different to the tos of the bot2user relation.

botstack <-- tos.html --> facebook <-- bot2user_tos.html --> user

any ideas?

Make a rack app?

I'd like to use Sinatra or just plain Rack to build a bot with the framework since the routing layer is the least interesting and complicated part of building a chatbot.
Relying on Rails, its memory footprint and bundled goodies that botstack would never use seems like overkill.

We just need two routes:

  • a webhook GET
  • a webhook POST

You would still get the benefits of being able to choose the endpoint (even in a Rack app) using Rack's map method.

Also necessary would be an integration guide for Rails, Sinatra and Rack in the docs.

What do you think?

How To Fix RecipientNotFound ((#100) No matching user found) Error?

Hi,
I was just toying around with the bot but I think I broke it. In my first conversation the bot stopped replying, not sure what action or text did this. The console shows the following error:

Facebook::Messenger::Bot::RecipientNotFound ((#100) No matching user found):
  lib/bot/base_bot_logic.rb:33:in `reply_message'
  lib/bot/bot_logic.rb:25:in `bot_logic'
  lib/bot/base_bot_logic.rb:207:in `handle_request'
  app/bots/main.rb:7:in `block in <top (required)>'

The "RESET" replys with a text, but my other reply is not sent. My bot logic is this:

class BotLogic < BaseBotLogic
    def self.setup
        set_welcome_message "Hey! Interesse an einer Domain? Ich kann Dir gerne sagen, ob eine Domain Deiner Wahl verfügbar ist!"
        set_get_started_button "bot_start_payload"
        set_bot_menu
    end

    def self.cron
        broadcast_all ":princess:"
    end

    def self.bot_logic
        ENV["DOMAIN_NAME"] = "https://2c654be7.eu.ngrok.io/"

        if @request_type == "CALLBACK" and @fb_params.payload == "RESET_BOT"
            @current_user.delete
            reply_message "Removed all your data from our servers."
            return
        end

        return reply_message "This is never sent"
    end
end

What did I do wrong?

Best way to write a bubble?

@ramonh I am thinking of the best way of defining bubbles with code:
spring_bot_for_messenger_1-xlarge_trans muac98d-ja8s9oi1lbgosvcxqla4yaqscerh0ndk4bq

send_bubble "http://image.com/image.png \n HEADLINE \n subheadline "
#or something like this?
send_bubble [{image: "http://", headline: "headline", description: "description"}]

also you can add buttons to them - hmm

another aproach would be content based:

send_bubble_websites --> list of urls, bots get title of websites and preview images etc ...

I am curious what you think about this topic!

Unregistered request during test : thread_settings

I clone the project and when I run rspec, this happens:

Verify the bot with the following verify_token :github
/home/luiz/.rvm/gems/ruby-2.3.3/gems/webmock-2.3.1/lib/webmock/http_lib_adapters/net_http.rb:114:in `request': Real HTTP connections are disabled. Unregistered request: POST https://graph.facebook.com/v2.6/me/thread_settings?access_token= with body '{"setting_type":"call_to_actions","thread_state":"existing_thread","call_to_actions":[{"type":"postback","title":"Reset","payload":"RESET_BOT"},{"type":"postback","title":"Info","payload":"INFO_BOT"}]}' with headers {'Content-Type'=>'application/json'} (WebMock::NetConnectNotAllowedError)

You can stub this request with the following snippet:

stub_request(:post, "https://graph.facebook.com/v2.6/me/thread_settings?access_token=").
  with(:body => "{\"setting_type\":\"call_to_actions\",\"thread_state\":\"existing_thread\",\"call_to_actions\":[{\"type\":\"postback\",\"title\":\"Reset\",\"payload\":\"RESET_BOT\"},{\"type\":\"postback\",\"title\":\"Info\",\"payload\":\"INFO_BOT\"}]}",
       :headers => {'Content-Type'=>'application/json'}).
  to_return(:status => 200, :body => "", :headers => {})
  • Rails 4.2.6
  • ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

docs via repo

http://yardoc.org/ ?

@pferdefleisch what's a good tool to document rails apps? or should I just add a docs/ folder and put *.MD files into it?

Reset sent messages

I am constantly running into this same issue while developing. I get an error and the app crashes. I fix the error, and when testing again it crashes because it registers the previously sent message as the current one. Any way to reset the messages sent to the bot through FB messenger?

user variables for common stuff

query
context
fb_first_name
fb_last_name
fb_timezone
fb_locale
fb_gender
fb_profile_pic
fb_id
last_clicked_button_name
last_processed_block_name
last_processed_block_id

Introducing: Webviews for Botstack

@pferdefleisch @ramonh @tosh @christophrumpel @legeekette @toshe @Cryt1c @evo42

Hi,

with 9c66197 I've added webview support. Now I am thinking about common webviews users would might need.

so far I´ve added a datepicker. Feel free to brainstorm Ideas.

@tosh: you already played around with camera support in webviews?

cheers,

David

how it works: bot framework creates a link to the webview - user has a small browser which loads a rails servlet. The HTML5 site makes a post request to another servlet which handles the request like a normal message. ecample: https://github.com/davidmann4/botstack/blob/master/app/views/webview/date_picker.html.erb

security: i generate a token (HMAC(user_id, rails_random_secret)) to sign the url of the webview. The webview also has a CSRF field. https://github.com/davidmann4/botstack/blob/master/app/controllers/webview_controller.rb#L6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.