lib/messenger/bot/transmitter.rb in messenger-bot-1.0.0 vs lib/messenger/bot/transmitter.rb in messenger-bot-1.0.2

- old
+ new

@@ -13,11 +13,12 @@ message: data } Messenger::Bot::Request.post("https://graph.facebook.com/v2.6/me/messages?access_token=#{Messenger::Bot::Config.access_token}", data) end - def get_profile - Messenger::Bot::Request.get("https://graph.facebook.com/v2.6/#{@sender_id}?fields=first_name,last_name,profile_pic&access_token=#{Messenger::Bot::Config.access_token}") + def get_profile(fields = nil) + fields ||= [:locale, :timezone, :gender, :first_name, :last_name, :profile_pic] + Messenger::Bot::Request.get("https://graph.facebook.com/v2.6/#{@sender_id}?fields=#{fields.join(",")}&access_token=#{Messenger::Bot::Config.access_token}") end end end end