Open ngdanghau opened 5 years ago
could you potst your function for this problem ?
const fs = require("fs");
const login = require("facebook-chat-api");
// Simple echo bot. It will repeat everything that you say.
// Will stop when you say '/stop'
login({appState: JSON.parse(fs.readFileSync('appstate.json', 'utf8'))},{pageID:00000000000}, (err, api) => {
if(err) return console.error(err);
api.setOptions({listenEvents: true});
api.listen((err, message) => {
api.sendMessage(message.body, message.threadID);
});
});
Same problem.
Bot infinite loop message.
I guess turning off selfListen might be broken on pages? Anyone wanting to investigate this might want to fiddle with this conditional or at least add some log statement to see if the message is getting past that point: https://github.com/Schmavery/facebook-chat-api/blob/61ddf3ce02767ac5c04f93232567cc7e67fb1afe/src/listen.js#L377-L380
Does the message senderID match either the logged-in user id or the page id or is it something completely different?
It's been a while since anyone did much work on pages so I wouldn't be surprised if it was something small. Pages may have been converted to use a different message type and we might need to add the == pageid check somewhere else in listen.js
You set pageID
is your page's id or 00000000000
??
Set 000000000
ในวันที่ อา. 25 พ.ย. 2018 14:12 น. Hongarc <notifications@github.com เขียนว่า:
You set pageID is your page's id or 00000000000 ??
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Schmavery/facebook-chat-api/issues/690#issuecomment-441420472, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ukN-zFOgixcD-926nogTGVJLIBYr0ks5uykLPgaJpZM4XbLZr .
Oh, you should set it to your page it.
00000000000
is example.
If you use 00000000000
, it same that you don't set it.
Please change it to your pageId and try again.
No not this problem i know it but problem is bot spam same chat.
ในวันที่ อา. 25 พ.ย. 2018 17:42 น. Hongarc <notifications@github.com เขียนว่า:
Oh, you should set it to your page it. 00000000000 is example. If you use 00000000000, it same that you don't set it.
Please change it to your pageId and try again.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Schmavery/facebook-chat-api/issues/690#issuecomment-441430911, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ukDvWwyTHDbNODeJv4KM-hnj4JDeKks5uynQggaJpZM4XbLZr .
Because you use 0
so v.message.sender_fbid.toString() === ctx.globalOptions.pageID is false
And your bot think that someone send to you.
@JameMieKunG could you fix it? same issue here :(
Hi. I have a problem with facebook-chat-api for fanpage. when i use listent for page, it reply infinite: ex: