python-zulip-api/contrib_bots/bots/helloworld/helloworld.py

25 lines
670 B
Python
Raw Normal View History

2017-05-23 15:05:27 -04:00
# See readme.md for instructions on running this code.
class HelloWorldHandler(object):
def usage(self):
return '''
This is a boilerplate bot that responds to a user query with
"beep boop", which is robot for "Hello World".
This bot can be used as a template for other, more
sophisticated, bots.
'''
def handle_message(self, message, client, state_handler):
content = 'beep boop'
client.send_message(dict(
type='stream',
to=message['display_recipient'],
subject=message['subject'],
content=content,
))
handler_class = HelloWorldHandler