mispy-archive / twitter_ebooks

Better twitterbots for all your friends~
MIT License
972 stars 140 forks source link

Mentions aren't received and DM responses are being sent to self #21

Closed anthonyherron closed 9 years ago

anthonyherron commented 10 years ago

I followed the basic instructions in setting this up but I'm finding a couple of issues.

Mentions aren't received at all and after a dm is received the bot replies to the sender, but then receives its own sent dm which it attempts to reply to until the API prevents it from doing so.

Has anyone come across this behaviour?

alyssais commented 10 years ago

I have experienced the DM issue, and got around it by checking that the DM sender was not the bot account before attempting to reply. Preventing this from happening in the library would probably be a good idea though, as I can't think this would ever be desired behaviour.

alyssais commented 10 years ago

lib/twitter_ebooks/bot.rb#L86:

        next if dm[:sender][:screen_name] == @username # Don't reply to self

It looks like there is a check there, it just doesn't seem to be working.

negatendo commented 10 years ago

Just a hunch, but is the casing of your bot's username on Twitter different than that used to generate your bot files? I have noticed issues similar to this if have discrepancies in this way.

For example, if your bot's Twitter username is Penman_ebooks (note the capital P) and you generated the bot files with the command

ebooks new penman_ebooks

...that might cause problems with framework.

ghost commented 9 years ago

3.0.1 does case-insensitive username comparisons and checks to make sure the configuration username matches the actual one on connect