Perhaps you are looking for this.
https://gyazo.com/6c21d4d8aa45ffcaeb82cd770c0b0017
If not working for you - must let me know.
I understand. But, as the bot is performing through API, i can't say advanced search can be done via Twitter API or not. But, we can explictly say that advanced search can be done via twitter.com site as you know it very well. I am not sure and thanks for posting the clear view of the advanced search. Martin will give you proper answer - i have asked him for your requirement.advanced search term is something like:
blaat -KW1 -KW3 +KW2 OR +fubar
There's no real logic, but a normal not-advanced search would be:
blaat
And
blaat OR fubar would be 'advanced' in Twitter parlance... As would be +blaat.
It's just a basic search but with logic operators in it...
Regards