DrydenLong / heads_need_bodies

A Reddit bot that matches bodies to heads/faces posted as comments.
2 stars 0 forks source link

Multiple faces in one comment #1

Open DrydenLong opened 10 years ago

DrydenLong commented 10 years ago

When a comment includes multiple faces, the bot will reply twice. It should only reply once since the comment id is being added to the already done list.

example: (••) ( ••)>⌐■-■ (⌐■_■)

CrystalMoogle commented 10 years ago

I think this is because the reply function is part of the for loop. Since everything within the for loop gets repeated for every head (including the reply function), it replies multiple times when there's multiple heads. You could instead create an output variable before the for loop and then add to that within the for loop, before sending that variable off in a reply after the for loop ends. I'm still pretty new to python myself though, so I could be looking at it wrong

DrydenLong commented 10 years ago

Crystal -

Good call, I'll play around with this and see if I can't get it to work. Thanks!