Comments (23)
@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.
getting the same problem..log in is ok but when sending message im just getting False response
from fbchat.
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.
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.
Can youd be more precise @Schmavery please ?
I have the same issue. Tried what you said, didn't work.
Thanks !
from fbchat.
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.
thx alot for the help @Schmavery <3
from fbchat.
@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.
@gbip @carpedm20 not yet :/
from fbchat.
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.
Did anyone fix it ? :)
from fbchat.
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.
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.
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.
{ 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.
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.
I fixed it! Wait. lemme send a pull request.
from fbchat.
@stefanhdao check PR
from fbchat.
working again thanks
from fbchat.
And how to send images and files now?
from fbchat.
Thank you, @thekindlyone. Could you also answer, how can I recieve images and stickers with api?
from fbchat.
@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.
@Bravo111 check #61. It should solve your issue.
from fbchat.
Related Issues (20)
- File loading progress
- Can't listen() Error #1357005 HOT 3
- Login not work
- FBchatException solution HOT 1
- Could not find fb_dtsg
- Could not find any ServerJSDefine. Please report this, along with the data below HOT 1
- Note for others unable to login HOT 4
- Failed parsing MQTT data on /t_trace as JSON HOT 3
- Sending AudioAttachments doesn't work HOT 4
- Trouble Logging in Error and info included
- Can't Log in HOT 7
- Search contact by mobile phone number
- Module not found Error!
- Error when sending request: Got 500 response.
- Closed
- Screenshot (Mar 25, 2023 6:10:08 AM)
- how can it get all feeds and comments
- GraphQL error #3252001: Rate limit exceeded / None HOT 3
- Sendlocalfile isn't working
- Is fbchat dead? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fbchat.