bibanon / py8chan

Python wrapper for the 8chan API, based on BASC-py4chan.
Do What The F*ck You Want To Public License
14 stars 7 forks source link

Typo/Error in #17

Closed erobert98 closed 5 years ago

erobert98 commented 5 years ago

In thread.py: starting at line 81 through 89

 if id is not None:
            if not t.replies:
                t.last_reply_id = t.topic.post_number
            else:
                t.last_reply_id = t.replies[-1].post_number

        else:
            t.want_update = True

These post_number should be post_id. on initial install and run, i always get error " topic has no post_number", i change it to post_id and it works.

erobert98 commented 5 years ago

I can post the full error but i dont think its necessary, this error has happened across 2 installs, on two computers, on linux and windows.

antonizoon commented 5 years ago

Now I get it, previous merged commits removed this vestigial line from py4chan without considering the consequences:

https://github.com/bibanon/py8chan/commit/ba0f1e19ce1240d4df97e25cb450fae4d7c7802d#diff-ebc25c8360a42605fc57f60fa5360f5aL55

there is a line for compatibility allowing multiple different names for the post ID: number = num = no = post_number = post_id

Although I will normalize the post_number variable name to post_id for better consistency for future programmer maintenance, removing the code would be an API breaking change so I will also restore that line.

antonizoon commented 5 years ago

https://github.com/bibanon/py8chan/commit/eca9196d3d43ec0a0eb69fb12783878441b2da4c

fixed