zulip-bots: Set bot_handler type to BotHandler.

- Set `bot_handler` type to `BotHandler`.
- Fix mypy issues in improperly typed variables, params and returns.

Fixes part of #639
This commit is contained in:
LoopThrough-i-j 2021-03-04 01:24:28 +05:30 committed by Anders Kaseorg
parent a994c58439
commit 1fb3d529a9
41 changed files with 156 additions and 119 deletions

View file

@ -1,4 +1,5 @@
from typing import Any, Dict
from typing import Dict
from zulip_bots.lib import BotHandler
def encrypt(text: str) -> str:
# This is where the actual ROT13 is applied
@ -30,7 +31,7 @@ class EncryptHandler:
Feeding encrypted messages into the bot decrypts them.
'''
def handle_message(self, message: Dict[str, str], bot_handler: Any) -> None:
def handle_message(self, message: Dict[str, str], bot_handler: BotHandler) -> None:
bot_response = self.get_bot_encrypt_response(message)
bot_handler.send_reply(message, bot_response)