bots: Refactor bots to use send_reply.

The send_reply function makes it easier for bots
to send messages. This commit updates all bots to
make use of this function, when possible.
This commit is contained in:
derAnfaenger 2017-05-24 21:49:44 +02:00 committed by Tim Abbott
parent f83ddd658c
commit c6d294385f
9 changed files with 13 additions and 112 deletions

View file

@ -90,19 +90,7 @@ class CommuteHandler(object):
# determines if bot will respond as a private message/ stream message
def send_info(self, message, letter, client):
if message['type'] == 'private':
client.send_message(dict(
type='private',
to=message['sender_email'],
content=letter,
))
else:
client.send_message(dict(
type='stream',
subject=message['subject'],
to=message['display_recipient'],
content=letter,
))
client.send_reply(message, letter)
def calculate_seconds(self, time_str):
times = time_str.split(',')