GithubHelp home page GithubHelp logo

Comments (11)

thekindlyone avatar thekindlyone commented on August 30, 2024

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.

litobro avatar litobro commented on August 30, 2024

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.

thekindlyone avatar thekindlyone commented on August 30, 2024

ugh, 3.x doesn't have dict.iteritems(). dict.items() in 3 does what iteritems did in 3.5.

from fbchat.

litobro avatar litobro commented on August 30, 2024

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.

thekindlyone avatar thekindlyone commented on August 30, 2024

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.

litobro avatar litobro commented on August 30, 2024

Replying to the author_id seems to always reply directly (1to1) with the author of the message, even in a group chat.

from fbchat.

thekindlyone avatar thekindlyone commented on August 30, 2024

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.

Schmavery avatar Schmavery commented on August 30, 2024

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.

litobro avatar litobro commented on August 30, 2024

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.

thekindlyone avatar thekindlyone commented on August 30, 2024

@litobro just follow the js and clone whatever it is doing in python. Worked for me so far. :P

from fbchat.

litobro avatar litobro commented on August 30, 2024

I'm going to close this issue and reopen as an issue about replying to groups.

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.