Skip to content

Commit 8cd3104

Browse files
aero31aeroshowell
authored andcommitted
mypy: Annotate helloworld bot.
1 parent 69ad29f commit 8cd3104

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# See readme.md for instructions on running this code.
22

3+
from typing import Any
34

45
class HelloWorldHandler(object):
5-
def usage(self):
6+
def usage(self) -> str:
67
return '''
78
This is a boilerplate bot that responds to a user query with
89
"beep boop", which is robot for "Hello World".
@@ -11,8 +12,8 @@ def usage(self):
1112
sophisticated, bots.
1213
'''
1314

14-
def handle_message(self, message, bot_handler):
15-
content = 'beep boop'
15+
def handle_message(self, message: Any, bot_handler: Any) -> None:
16+
content = 'beep boop' # type: str
1617
bot_handler.send_reply(message, content)
1718

1819
handler_class = HelloWorldHandler

zulip_bots/zulip_bots/bots/helloworld/test_helloworld.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from zulip_bots.test_lib import StubBotTestCase
44

55
class TestHelpBot(StubBotTestCase):
6-
bot_name = "helloworld"
6+
bot_name = "helloworld" # type: str
77

8-
def test_bot(self):
8+
def test_bot(self) -> None:
99
dialog = [
1010
('', 'beep boop'),
1111
('help', 'beep boop'),

0 commit comments

Comments
 (0)