Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow config.request_command to trigger as long as it finds keywords #24

Open
kanyawest42 opened this issue Jun 2, 2020 · 1 comment

Comments

@kanyawest42
Copy link

currently, the request_command only works if the bot receives a tweet that matches the entire string
how do I make it so that as long as any part of the string is involved, it'll accept it?

Example:

  • request command = how are you
  • User tweets at the bot "@bot hello how are you?"
    the bot will respond because "how are you" is found in the string

thanks in advance

@joaquinlpereyra
Copy link
Owner

joaquinlpereyra commented Jun 18, 2020

Hey @kanyawest42

You should only need to change this function: https://github.com/joaquinlpereyra/twitterImgBot/blob/master/bot/requests.py#L55

    """Return True if mention start with the request_command."""
    return mention.text.lower().startswith(request_command.lower())

It should do something like return request_command.lower() in mention.text.lower().

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants