mispy-archive/twitter_ebooks

Blocking users does not prevent infinite reply chain

Closed this issue · 3 comments

If my bot blocks another bot or adds it to its blacklist, this does not prevent my bot from tweeting at the blocked bot and ended up in an infinite reply chain.
See this thread, where versacejs_bot has wheelofbdsm blocked and blacklisted but they are still tweeting at one other: https://twitter.com/versacejs_bot/status/684433850420838401

Presumably, blacklisting/blocking another user means you don't want to tweet at them either.
My suggestion is to add something in the on_mention handler that checks to see if the mention is from a user on the blacklist, and returning if so. Happy to open a PR to this effect but also open to other suggestions.

I see what you mean. It appears blacklisting performs the block - but that's it!

An alternative fix is it could return from recieve_event() around here, after the block https://github.com/mispy/twitter_ebooks/blob/master/lib/twitter_ebooks/bot.rb#L268 to prevent any other further actions.

Regardless I agree about the expected behavior. The bot should not reply if blacklisted imo.

begins chanting PULL REQUEST. PULL REQUEST. PULL REQUEST.

That is a better solution, @negatendo 😄
/me goes to open PR

Makes sense, thanks!