# Path: src/plugins/utilities.py
# class BasePlugin:
#     """Base class for Botty plugins. Should be imported from plugins using `from .utilities import BasePlugin`."""
#     def __init__(self, bot):
#         self.bot = bot
#         self.logger = bot.logger.getChild(self.__class__.__name__)
# 
#         self.flows = {}
# 
#     def get_history_files(self):
#         """Returns a mapping from channel IDs to absolute file paths of their history entries"""
#         for dirpath, _, filenames in os.walk(CHAT_HISTORY_DIRECTORY):
#             result = {}
#             for history_file in filenames:
#                 channel_id, extension = os.path.splitext(os.path.basename(history_file))
#                 if extension != ".json": continue
#                 result[channel_id] = os.path.join(dirpath, history_file)
#             return result
#         return {}
# 
#     def on_step(self): return False
#     def on_message(self, message): return False
# 
#     def say(self, sendable_text, *, channel_id, thread_id=None):          return self.bot.say(sendable_text, channel_id=channel_id, thread_id=thread_id)
#     def say_raw(self, text, *, channel_id, thread_id=None):               return self.bot.say(self.text_to_sendable_text(text), channel_id=channel_id, thread_id=thread_id)
#     def say_complete(self, sendable_text, *, channel_id, thread_id=None): return self.bot.say_complete(sendable_text, channel_id=channel_id, thread_id=thread_id)
#     def say_raw_complete(self, text, *, channel_id, thread_id=None):      return self.bot.say_complete(self.text_to_sendable_text(text), channel_id=channel_id, thread_id=thread_id)
#     def respond(self, sendable_text, *, as_thread=False):                 return self.bot.respond(sendable_text, as_thread=as_thread)
#     def respond_raw(self, text, *, as_thread=False):                      return self.bot.respond(self.text_to_sendable_text(text), as_thread=as_thread)
#     def respond_complete(self, sendable_text, *, as_thread=False):        return self.bot.respond_complete(sendable_text, as_thread=as_thread)
#     def respond_raw_complete(self, text, *, as_thread=False):             return self.bot.respond_complete(self.text_to_sendable_text(text), as_thread=as_thread)
#     def react(self, channel_id, timestamp, emoticon):                     return self.bot.react(channel_id, timestamp, emoticon)
#     def unreact(self, channel_id, timestamp, emoticon):                   return self.bot.unreact(channel_id, timestamp, emoticon)
#     def reply(self, emoticon):                                            return self.bot.reply(emoticon)
#     def unreply(self, emoticon):                                          return self.bot.unreply(emoticon)
#     def get_channel_name_by_id(self, channel_id):                         return self.bot.get_channel_name_by_id(channel_id)
#     def get_channel_id_by_name(self, channel_name):                       return self.bot.get_channel_id_by_name(channel_name)
#     def get_user_id_by_name(self, user_name):                             return self.bot.get_user_id_by_name(user_name)
#     def get_user_name_by_id(self, user_id):                               return self.bot.get_user_name_by_id(user_id)
#     def get_direct_message_channel_id_by_user_id(self, user_id):          return self.bot.get_direct_message_channel_id_by_user_id(user_id)
#     def get_user_info_by_id(self, user_id):                               return self.bot.get_user_info_by_id(user_id)
#     def get_user_is_bot(self, user_id):                                   return self.bot.get_user_is_bot(user_id)
#     def text_to_sendable_text(self, text):                                return self.bot.text_to_sendable_text(text)
#     def sendable_text_to_text(self, sendable_text):                       return self.bot.sendable_text_to_text(sendable_text)
#     def get_bot_user_id(self):                                            return self.bot.bot_user_id


import re, json
import requests
from functools import lru_cache
from .utilities import BasePlugin
#!/usr/bin/env python3




UW_API_KEY = "123afda14d0a233ecb585591a95e0339"
UW_API_BASE = "http://api.uwaterloo.ca/v2/"

@lru_cache(maxsize=128)

# Path: src/plugins/utilities.py
# class BasePlugin:
#     """Base class for Botty plugins. Should be imported from plugins using `from .utilities import BasePlugin`."""
#     def __init__(self, bot):
#         self.bot = bot
#         self.logger = bot.logger.getChild(self.__class__.__name__)
# 
#         self.flows = {}
# 
#     def get_history_files(self):
#         """Returns a mapping from channel IDs to absolute file paths of their history entries"""
#         for dirpath, _, filenames in os.walk(CHAT_HISTORY_DIRECTORY):
#             result = {}
#             for history_file in filenames:
#                 channel_id, extension = os.path.splitext(os.path.basename(history_file))
#                 if extension != ".json": continue
#                 result[channel_id] = os.path.join(dirpath, history_file)
#             return result
#         return {}
# 
#     def on_step(self): return False
#     def on_message(self, message): return False
# 
#     def say(self, sendable_text, *, channel_id, thread_id=None):          return self.bot.say(sendable_text, channel_id=channel_id, thread_id=thread_id)
#     def say_raw(self, text, *, channel_id, thread_id=None):               return self.bot.say(self.text_to_sendable_text(text), channel_id=channel_id, thread_id=thread_id)
#     def say_complete(self, sendable_text, *, channel_id, thread_id=None): return self.bot.say_complete(sendable_text, channel_id=channel_id, thread_id=thread_id)
#     def say_raw_complete(self, text, *, channel_id, thread_id=None):      return self.bot.say_complete(self.text_to_sendable_text(text), channel_id=channel_id, thread_id=thread_id)
#     def respond(self, sendable_text, *, as_thread=False):                 return self.bot.respond(sendable_text, as_thread=as_thread)
#     def respond_raw(self, text, *, as_thread=False):                      return self.bot.respond(self.text_to_sendable_text(text), as_thread=as_thread)
#     def respond_complete(self, sendable_text, *, as_thread=False):        return self.bot.respond_complete(sendable_text, as_thread=as_thread)
#     def respond_raw_complete(self, text, *, as_thread=False):             return self.bot.respond_complete(self.text_to_sendable_text(text), as_thread=as_thread)
#     def react(self, channel_id, timestamp, emoticon):                     return self.bot.react(channel_id, timestamp, emoticon)
#     def unreact(self, channel_id, timestamp, emoticon):                   return self.bot.unreact(channel_id, timestamp, emoticon)
#     def reply(self, emoticon):                                            return self.bot.reply(emoticon)
#     def unreply(self, emoticon):                                          return self.bot.unreply(emoticon)
#     def get_channel_name_by_id(self, channel_id):                         return self.bot.get_channel_name_by_id(channel_id)
#     def get_channel_id_by_name(self, channel_name):                       return self.bot.get_channel_id_by_name(channel_name)
#     def get_user_id_by_name(self, user_name):                             return self.bot.get_user_id_by_name(user_name)
#     def get_user_name_by_id(self, user_id):                               return self.bot.get_user_name_by_id(user_id)
#     def get_direct_message_channel_id_by_user_id(self, user_id):          return self.bot.get_direct_message_channel_id_by_user_id(user_id)
#     def get_user_info_by_id(self, user_id):                               return self.bot.get_user_info_by_id(user_id)
#     def get_user_is_bot(self, user_id):                                   return self.bot.get_user_is_bot(user_id)
#     def text_to_sendable_text(self, text):                                return self.bot.text_to_sendable_text(text)
#     def sendable_text_to_text(self, sendable_text):                       return self.bot.sendable_text_to_text(sendable_text)
#     def get_bot_user_id(self):                                            return self.bot.bot_user_id


# Path: src/plugins/uw_courses.py
import re, json
import requests
from functools import lru_cache
from .utilities import BasePlugin

#!/usr/bin/env python3




UW_API_KEY = "123afda14d0a233ecb585591a95e0339"
UW_API_BASE = "http://api.uwaterloo.ca/v2/"

@lru_cache(maxsize=128)

def uwapi(endpoint, params={}):