fbchat icon indicating copy to clipboard operation
fbchat copied to clipboard

Can't create new poll option in `updatePollVote`

Open TheLastGimbus opened this issue 4 years ago • 1 comments

Description of the problem

I wrote a little script that automatically votes on a poll some time ago. It was working perfectly, but I recently saw that it suddently doesn't.

Code to reproduce

# This works(of course if poll has some options):
self.updatePollVote(poll.uid, option_ids=[poll.options[0].uid])
# This doesn't:
self.updatePollVote(poll.uid, new_options=['New Option'])

Traceback

Traceback (most recent call last):
  File "/home/mateusz/.local/lib/python3.7/site-packages/fbchat/_client.py", line 2820, in _parse_message
    self._parse_payload(topic, data)
  File "/home/mateusz/.local/lib/python3.7/site-packages/fbchat/_client.py", line 2758, in _parse_payload
    self._parseDelta(delta)
  File "/home/mateusz/.local/lib/python3.7/site-packages/fbchat/_client.py", line 2515, in _parseDelta
    msg=delta,
  File "auto-voter.py", line 27, in onPollCreated
    self.updatePollVote(poll.uid, option_ids=[], new_options=['New Option'])
  File "/home/mateusz/.local/lib/python3.7/site-packages/fbchat/_client.py", line 1860, in updatePollVote
    fb_error_message=j.get("errorMessage"),
fbchat._exception.FBchatFacebookError: Failed updating poll vote: None

Environment information

  • Python version - 3.7.4
  • fbchat version - 1.9.6

I checked if I cant manually create new options (in case that was some weird-facebook-permission stuff). I can with no problem.

TheLastGimbus avatar Feb 06 '20 19:02 TheLastGimbus

Hmm, just tested today, and I can't reproduce it, can you try enabling debug logging by putting the code below in the start of your module, and give me the output (with personal information redacted)?

import logging
logging.basicConfig(level=logging.DEBUG)

That way we can perhaps see what error message Facebook returns

madsmtm avatar Feb 08 '20 19:02 madsmtm