code
noname
config = json.load(open('config.json', 'r'))
TOKEN = config['token']
DEV = True
signup = config['signup']
refr = config['ref']
admins = config["admins"]
data = []
dash_key = [['ETH address'],['Referral Link','Referred'],['Balance','Details']]
admin_key = [['Users','Get List']]
text_inp = str(input())
webhook_url = 'Your Webhook'
PORT = int(os.environ.get('PORT','8443'))
def start(update, context):
if update.message.chat.type == 'private':
user = str(update.message.chat.username)
if user not in data['users']:
data['users'].append(user)
if user not in data['eth']:
data['eth'][user] = ""
ref_id = update.message.text.split()
if len(ref_id) > 1:
data['ref'][user] = ref_id[1]
if str(ref_id[1]) not in data['referred']:
data['referred'][str(ref_id[1])] = 1
else:
data['referred'][str(ref_id[1])] += 1
else:
data['ref'][user] = 0
data['total'] += 1
data['id'][user] = data['total']
json.dump(data,open('users.json','w'))
msg = config['intro']
update.message.reply_text(msg)
update.message.reply_text(started_msg)
else:
welcome_msg = "Hello and welcome to our bot!"
reply_markup = ReplyKeyboardMarkup(dash_key,resize_keyboard=True)
update.message.reply_text(welcome_msg,reply_markup=reply_markup)
else:
msg = '{} \n. I don\'t reply in group, come in private'.format(config['intro'])
update.message.reply_text(msg)