promo_alert.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:ShiokBot 作者: kianhean 项目源码 文件源码
def subscribe(user_id):
    """ subscribe to the database """
    db = dataset.connect(database_url)
    table = db['subscriptions']

    if table.find_one(id_user=user_id) is None:
        table.insert(dict(id_user=user_id))
        text_ = """This thread has succesfully subscribed to recieve New Uber Codes! \nI will send you the latest Uber Promo Codes when they get released so that you can apply them first!\n\n"""
        text_ += """These are the latest codes right now\n\n"""
        new_codes = get_code()

        for key in new_codes:
            text_ += "<b>" + key + "</b> | Expires - " + new_codes[key][0] + " | " + new_codes[key][1]
            text_ += "\n"
        return text_
    else:
        return "This thread is already subscribed to recieve New Uber Codes!"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号