Comments (11)
PR #56 adds getUserInfo to get name from uid (you probably want to maintain a dictionary of contacts in your subclassed Client). As for thread_id, have you checked the metadata?
from fbchat.
I'm going through the metadata now trying to access a thread_id, there were some issues for python 3.5 in PR #56 for getUserInfo. I was getting an error on an iteritems() call and hadn't had time to debug the compatibility yet.
from fbchat.
ugh, 3.x doesn't have dict.iteritems(). dict.items() in 3 does what iteritems did in 3.5.
from fbchat.
Unless I'm mistaken the metadata doesn't contain the thread_id either. It does have a "offlineThreadingId" that if I try to send a message to I receive a 500 error in response.
from fbchat.
I fixed the iteritems thing, but don't know about thread_id. Can't you just reply to the author_id? Does it not always reply to same thread?
from fbchat.
Replying to the author_id seems to always reply directly (1to1) with the author of the message, even in a group chat.
from fbchat.
The group chat in the js wrapper has some extra things going on. But the current PR situation is pretty messed up due to my inexperience with git, so am not doing any extra functionality till my current PR's are merged or rejected.
from fbchat.
In the js wrapper, it looks like we're first checking if the tid
field on the message exists, and then preferring to use that, then trying to use the thread_fbid
and failing that, the other_user_fbid
. It's possible that this is a little out of date and handles cases that no longer exist, but it seems to be working.
from fbchat.
Poking around some more now, it seems that the threadFbId
and actorFbId
definitely exist in the metadata. Not sure how I missed the tread one. Don't see a tid
anywhere, but I'm going to have to think a bit about how to implement this if the maintainer wants it part of the main library. Otherwise I can just implement a simple fall through case on my bot.
EDIT: It seems as though the send()
function does not actually support replying to groups properly though. It sends it as other_user_fbid which then still returns a 200 but the message does not appear in the group. Perhaps @Schmavery could provide some insight?
from fbchat.
@litobro just follow the js and clone whatever it is doing in python. Worked for me so far. :P
from fbchat.
I'm going to close this issue and reopen as an issue about replying to groups.
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.