GithubHelp home page GithubHelp logo

Comments (23)

thekindlyone avatar thekindlyone commented on August 30, 2024 1

@Bravo111 check #56 .. fixed image sending problem. Forgot to do the api change fixes for images. Also added example in readme.
Basically

    client.sendLocalImage(friend.uid,message='<message text>',image='<path/to/image/file>') # send local image
    imgurl = "http://i.imgur.com/LDQ2ITV.jpg"
    client.sendRemoteImage(friend.uid,message='<message text>', image=imgurl) # send image from image url

from fbchat.

chrisjohneder avatar chrisjohneder commented on August 30, 2024

getting the same problem..log in is ok but when sending message im just getting False response

from fbchat.

Schmavery avatar Schmavery commented on August 30, 2024

Hey guys, our api just died too because facebook changed their endpoint for sending messages. Feel free to check out this for a fix.
Basically remove message_batch[0] from these and change the sendurl to https://www.facebook.com/messaging/send/ and I'd imagine it will work.

from fbchat.

Kobito123 avatar Kobito123 commented on August 30, 2024

thx alot =)
EDIT: I deletet all the " message_batch[0] " in the client.py and changed https://www.facebook.com/ajax/mercury/send_messages.php to https://www.facebook.com/messaging/send/

but it still doesnt work :/ what am I missing?

EDIT2: it fixed their api with these changes hm :/

from fbchat.

gbip avatar gbip commented on August 30, 2024

Can youd be more precise @Schmavery please ?
I have the same issue. Tried what you said, didn't work.
Thanks !

from fbchat.

Schmavery avatar Schmavery commented on August 30, 2024

Sorry guys, I don't actually work on the python version of this api, I was just trying to give some relevant tips. A good rule of thumb is to try the operation in a browser and compare the request that gets sent there to the one that the api is sending 😄 good luck!

from fbchat.

Kobito123 avatar Kobito123 commented on August 30, 2024

thx alot for the help @Schmavery <3

from fbchat.

gbip avatar gbip commented on August 30, 2024

@Kobito123 did you solved it ? I tried fixing it by following what has been done on the javascript version of the API, but i can't make it work...

from fbchat.

Kobito123 avatar Kobito123 commented on August 30, 2024

@gbip @carpedm20 not yet :/

from fbchat.

chrisjohneder avatar chrisjohneder commented on August 30, 2024

how about these? it seems it's working but could not implement on client.py

https://m.facebook.com/messages/compose?ids=
https://m.facebook.com/messages/send/?icm=1

from fbchat.

Kobito123 avatar Kobito123 commented on August 30, 2024

Did anyone fix it ? :)

from fbchat.

stefanhdao avatar stefanhdao commented on August 30, 2024

Any updates on this? I've been trying to edit the CLient myself but not a whole lot of luck to get it working.

from fbchat.

thekindlyone avatar thekindlyone commented on August 30, 2024

I tried to replicate the js version commits that made it work again. 404. :(

How do you get error logs on this.. like the js project has?

from fbchat.

stefanhdao avatar stefanhdao commented on August 30, 2024

I'm not sure but I was just printing out the response and it just says we're hitting an invalid page. Maybe there is a setting that we are not sending that the js version does.

from fbchat.

thekindlyone avatar thekindlyone commented on August 30, 2024
 { client: 'mercury',
  action_type: 'ma-type:user-generated-message',
  author: 'fbid:100010359372619',
  timestamp: 1471400345995,
  timestamp_absolute: 'Today',
  timestamp_relative: '4:19',
  timestamp_time_passed: '0',
  is_unread: false,
  is_cleared: false,
  is_forward: false,
  is_filtered_content: false,
  is_filtered_content_bh: false,
  is_filtered_content_account: false,
  is_filtered_content_quasar: false,
  is_filtered_content_invalid_app: false,
  is_spoof_warning: false,
  source: 'source:chat:web',
  'source_tags[0]': 'source:chat',
  body: 'TEST BOT: aaf',
  html_body: false,
  ui_push_phase: 'V3',
  status: '0',
  offline_threading_id: '6171500356804827443',
  message_id: '6171500356804827443',
  threading_id: '<1471400345996:[email protected]>',
  'ephemeral_ttl_mode:': '0',
  manual_retry_cnt: '0',
  has_attachment: false,
  signatureID: '7ed6ba49',
  'specific_to_list[0]': 'fbid:100000121491279',
  'specific_to_list[1]': 'fbid:100010359372619',
  'other_user_fbid': '100000121491279' }

This is a sample working payload(from a comment in the js project)
@stefanhdao Do you know why there are quotes in some keys and not in others?

from fbchat.

stefanhdao avatar stefanhdao commented on August 30, 2024

I didn't notice that, this is what their code looks like. Let me do a little more digging.

var form = {

      'client' : 'mercury',
      'action_type' : 'ma-type:user-generated-message',
      'author' : 'fbid:' + ctx.userID,
      'timestamp' : Date.now(),
      'timestamp_absolute' : 'Today',
      'timestamp_relative' : utils.generateTimestampRelative(),
      'timestamp_time_passed' : '0',
      'is_unread' : false,
      'is_cleared' : false,
      'is_forward' : false,
      'is_filtered_content' : false,
      'is_filtered_content_bh':false,
      'is_filtered_content_account':false,
      'is_filtered_content_quasar':false,
      'is_filtered_content_invalid_app':false,
      'is_spoof_warning' : false,
      'source' : 'source:chat:web',
      'source_tags[0]' : 'source:chat',
      'body' : msg.body ? msg.body.toString() : "",
      'html_body' : false,
      'ui_push_phase' : 'V3',
      'status' : '0',
      'offline_threading_id' : messageAndOTID,
      'message_id' : messageAndOTID,
      'threading_id': utils.generateThreadingID(ctx.clientID),
      'ephemeral_ttl_mode:': '0',
      'manual_retry_cnt' : '0',
      'has_attachment' : !!(msg.attachment || msg.url || msg.sticker),
      'signatureID' : utils.getSignatureID(),
    };

from fbchat.

thekindlyone avatar thekindlyone commented on August 30, 2024

I fixed it! Wait. lemme send a pull request.

from fbchat.

thekindlyone avatar thekindlyone commented on August 30, 2024

@stefanhdao check PR

from fbchat.

chrisjohneder avatar chrisjohneder commented on August 30, 2024

working again thanks

from fbchat.

Bravo111 avatar Bravo111 commented on August 30, 2024

And how to send images and files now?

from fbchat.

Bravo111 avatar Bravo111 commented on August 30, 2024

Thank you, @thekindlyone. Could you also answer, how can I recieve images and stickers with api?

from fbchat.

thekindlyone avatar thekindlyone commented on August 30, 2024

@Bravo111 , I don't think it is working at the moment. Open a new issue will you?

EDIT: I know what the problem is now, somewhat. Will fix later. But none of this stuff is being merged.. maybe I should wait till @carpedm20 shows up.

from fbchat.

thekindlyone avatar thekindlyone commented on August 30, 2024

@Bravo111 check #61. It should solve your issue.

from fbchat.

Related Issues (20)

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.