micah5 / ace-attorney-reddit-bot

👨🏼‍⚖️ reddit bot that turns comment chains into ace attorney scenes
Do What The F*ck You Want To Public License
772 stars 53 forks source link

Crash if 15 or more authors #23

Open LuisMayo opened 3 years ago

LuisMayo commented 3 years ago

It'll crash if there are more than 15 authors in the scene. I tried to solve it using this code

available_characters = list(
                filter(
                    lambda character: character not in characters, rnd_characters
                )
            )
            if (len(available_characters) == 0):
                available_characters = rnd_characters
            rnd_character = random.choice(available_characters)

But it crash at a later point due to how the code works Thanks