def sub(bot, update):
    if Helper.not_a_group(update):
        return

    SubscriptionHandler.add_to_subscribers(update.message.chat.id,
                       update.message.from_user.id)

    update.message.reply_text('%s has subscribed to coffee runs. You will receive a notification from yours truly when a coffee run starts in group: %s.\n\nClick here @%s and press "Send Message" > "START" so that I can send you notifications. Delete that chat and you will never hear from me again \U0001F608' % (update.message.from_user.first_name, update.message.chat.title, bot.get_me().username))
def unsub(bot, update):
    if Helper.not_a_group(update):
        return

    SubscriptionHandler.remove_from_subscribers(update.message.chat.id,
                            update.message.from_user.id)

    update.message.reply_text('%s has unsubscribed from coffee runs \U0001F612 One less drink to buy when kopi run starts in group: %s' % (update.message.from_user.first_name, update.message.chat.title))
def done(bot, update, args):
    if Helper.not_a_group(update) or Helper.not_authorised(update):
        return

    for arg in args:
        try:
            OrderHandler.update_done_order(bot, update.message.chat.id, int(arg))
        except Exception as error:
            logging.warning('Unable to mark item "%s" as done, error: "%s"' % (arg, error))
def start(bot, update):
    if Helper.not_a_group(update) or Helper.not_authorised(update):
        return

    # message = update.message.reply_text('%s volunteered to be the kopi boy/girl, please order via the notification sent to you privately. Use /sub to subscribe to future notifications. Order now or else...' % update.message.from_user.first_name)
    message = update.message.reply_text("Stanly's Coffee is now open! Please order via the notification sent to you privately. Use /sub to subscribe to future notifications.")
    OrderHandler.create_orders_file(message.chat.id, message.message_id, message.text)

    NotificationHandler.send_notification_to_subscribers(bot, update, message)