- if match.command("help"):
- await bot.api.send_text_message(
- room.room_id, help_text)
-
- if match.command("list"):
- student_list = f"Known students are {STUDENTS}."
- await bot.api.send_text_message(
- room.room_id, student_list)
-
- person = ''
- if match.command("get"):
- print(match.args())
- if(len(match.args()) < 2):
- result = ['Please specify person to get assignments for.']
- else:
- person = match.args()[1]
-
- if(len(match.args()) > 2):
- day = match.args()[2]
- else:
- day = today()
-
- if(person and day):
- await bot.api.send_text_message(room.room_id, f'Fetching assignments for {person} on {day}')
- results = get_assignments(person, day)
- else:
- results = ['Oops.']
-
- if len(results) < 3:
- results = [f'No assignments found for {person} on {day}.']
-
- for line in results:
-
- await bot.api.send_text_message(
- room.room_id, line)
-
-
-@bot.listener.on_message_event
-async def chores(room, message):
- match = botlib.MessageMatch(room, message, bot, '!chore')
-
- if not match.is_not_from_this_bot() and match.prefix():
- return