From 2ce64b71b217357eadf86f6367b1ca683551b322 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 5 Sep 2016 14:09:25 -0400 Subject: [PATCH] Skeleton of Cookie --- plugins/cookie.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 plugins/cookie.py diff --git a/plugins/cookie.py b/plugins/cookie.py new file mode 100644 index 0000000..a169d4d --- /dev/null +++ b/plugins/cookie.py @@ -0,0 +1,27 @@ +# cookie.py +# Pin management +# Eryn Wells + +import logging + +LOGGER = logging.getLogger('cookie') + +def process_hello(data): + # TODO: Get list of channels I'm in. + # TODO: Query for pins from each channel. + # TODO: Determine if a message should be unpinned to make room for next pin. + LOGGER.info('Hello!') + +def process_channel_joined(data): + # TODO: Query for pins from this channel. + # TODO: Determine if a message should be unpinned to make room for next pin. + LOGGER.info('Joined #{}'.format(data['channel']['name'])) + +def process_pin_added(data): + # TODO: Unpin oldest message if needed. + # TODO: Write that pin to a file. + LOGGER.info('Pin added') + +def process_message(data): + # TODO: !cookie + LOGGER.info('Received message')