Closed Doomkyn closed 7 years ago
Hi @Doomkyn ,
I am not using the bot currently but I continue to maintain it with help of people (like you :heart: ) The issue probably come from the old facebook-chat-api version that we use. We should probably give a try to update the update. https://github.com/Schmavery/facebook-chat-api
Can you change https://github.com/Liryna/FacebookBot/blob/master/package.json#L18 to 1.2.0 ? probably there is not API changes and it will work.
Thanks for the quick reply @Liryna ,
Updating the api works on one of my accounts, unfortunately not for the other. Anyway, I tested it with the working account and it seems like the facebook listener
api.listen(function callback(err, message) {
retrive different information than before. This is the new api response:
{ type: 'message',
senderID: '100004305609XXX',
body: 'prova',
threadID: '100004305609XXX',
messageID: 'mid.1487067590937:deb17c6XXX',
attachments: [],
timestamp: '1487067590XXX',
isGroup: false }
So
if(message.participantNames.length > 1){
should be replaced with
if(message.isGroup){
And
message.threadName
message.senderName
should be replaced with
message.threadID
message.senderID
althrough we should find a way to get the Name from the ID.
I think that's already somewhere but can't put all together. Will keep trying anyway.
EDITED to cover IDs :P
Ah @Doomkyn ! strange that didnt work for the other :cry: do you have double auth ? or any difference ?
I tried to figure that out @Liryna but can't find the difference. I'm not really looking for a solution right now, I prefer fixing the code problems due to the facebook api changes first. Will keep you updated if you want
I would really be happy about it ! specially if you can make a PR :heart:
I'm sorry I don't think this is a good idea cause I'm actually changing other things too (for example when you receive a message on fb the bot will forward 3 messages on the telegram chat: the first will contain the name, the second the thumb, the third the body) When I finish this I could look into your code and fix things without touching the behavior.
Thanks again you're really helpful! I'll close this for now :)
Hello, I know you're probably not working on this project anymore but it seems like everytime I try to use this bot, it blocks my account for security reasons (even if I set the forceLogin to true as suggested). Do you have any idea of what I can do to solve this? Even changing facebook settings is okay for me if you know where to act! Thanks!