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!"
评论列表
文章目录