zulip / python-zulip-api

Python library for the Zulip API.
https://zulip.com/api/
Apache License 2.0
350 stars 356 forks source link

zulip-bots: Add `BotHandler` Protocol. #656

Closed LoopThrough-i-j closed 3 years ago

LoopThrough-i-j commented 3 years ago
LoopThrough-i-j commented 3 years ago

@neiljp thanks for pointing out some improvements. I had actually added inherited the BotHandler class and added some helper functions in the BotHandler, confused by the innumerable number of errors thrown by the bots after the 2nd commit, which I slowly debugged and figured out and then considered keeping the BotHandler the same.

andersk commented 3 years ago

In order to use this in zulip/zulip, we also need to adjust zulip_bots.lib.extract_query_without_mention to take BotHandler instead of ExternalBotHandler. There may be other such adjustments that make sense.

LoopThrough-i-j commented 3 years ago

In order to use this in zulip/zulip, we also need to adjust zulip_bots.lib.extract_query_without_mention to take BotHandler instead of ExternalBotHandler. There may be other such adjustments that make sense.

Thanks, I didn't know. Will get things fixed soon.