Open EDM115 opened 1 year ago
DB scheme :
vip_users = unzipper_db["vip_users"]
user_id: {int} The user ID
subscription: {date} When the subscription starts
ends: {date} When the subscription ends
used: {str} [paypal, telegram, sponsor, bmac] Which platform had been used
billed: {str} [monthly, yearly] At which frequency the user is billed
early: {bool} Is the user a early supporter (can be obtained only the first 3 months)
donator: {bool} Is the user also a donator
started: {date} When does the user ever started a subscription
successful: {int} How many successful payments had been done
gap: {bool} Is there been any gap between payments
gifted: {bool} If the user had been gifted a Premium plan (enjoy discounts)
referral: {str} Your referral code (enjoy discounts x2) encoded using base58check
lifetime: {bool} A special perk that only few people can have
date being :
datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')
referral being :
import base58check
uid = 854158484
print("base = ", uid)
encoded = base58check.b58encode(str(uid).encode("ascii"))
print("round 1 = ", encoded.decode("ascii"))
encoded = base58check.b58encode(encoded)
print("round 2 = ", encoded.decode("ascii"))
decoded = base58check.b58decode(encoded)
print("round 1 = ", decoded.decode("ascii"))
decoded = base58check.b58decode(decoded)
print("round 2 = ", int(decoded.decode("ascii")))
base = 854158484
round 1 = iVnJXkc8Wz83
round 2 = 2zHzuEXgUySapa2Ee
round 1 = iVnJXkc8Wz83
round 2 = 854158484
referral simplified to :
import base58check
def get_referral_code(uid):
return base58check.b58encode(base58check.b58encode(str(uid).encode("ascii"))).decode("ascii")
def get_referral_uid(referral_code):
return int(base58check.b58decode(base58check.b58decode(referral_code).decode("ascii")).decode("ascii"))
Planned Features :
Process several taskstoo complex