Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import telebot
- from telebot import types
- import re
- from dbHelp import DBHelper # Script that contains functions for my database
- import numpy
- import datetime
- import time
- covidTOKEN="token"
- bot=telebot.TeleBot(covidTOKEN)
- @bot.message_handler(commands=['drop'])
- def drop_message(message):
- db=DBHelper()
- db.drop_table()
- @bot.message_handler(commands=['start'])
- def start_message(message):
- comnd=message.text
- comndS=comnd.split(" ")
- comSlast=comndS[-1]
- if comSlast=='/start':
- db=DBHelper()
- db.setup()
- markup = telebot.types.InlineKeyboardMarkup()
- acct=telebot.types.InlineKeyboardButton(text='👤 Account', callback_data=1)
- reg=telebot.types.InlineKeyboardButton(text='👥 Register', callback_data=2)
- markup.row(acct,reg)
- bot.send_message(message.chat.id, text="WELCOME\n\nCLICK ON 'REGISTER'.\n\n AFTER YOU REGISTER YOUR BALANCE WILL START TO INCREASE", reply_markup=markup,parse_mode='html')
- @bot.callback_query_handler(func=lambda call: True)
- def query_handler(call):
- markup = telebot.types.InlineKeyboardMarkup()
- acct=telebot.types.InlineKeyboardButton(text='👤 Account', callback_data=1)
- reg=telebot.types.InlineKeyboardButton(text='👥 Referrals', callback_data=2)
- bot.answer_callback_query(callback_query_id=call.id)
- if call.data == '1':
- markup.row(acct,reg)
- fname=call.message.chat.first_name
- lname=call.message.chat.last_name
- db=DBHelper()
- bal1=db.get_amount()
- if bal1==[]:
- bal=0
- else:
- bal=bal1[0][0]
- if lname==None:
- user=fname
- else:
- user=fname+' '+lname
- msg='👤 <b>GENERAL INFORMATION</b>\n\n◽ User: '+user+'\n◽ Balance: '+str(bal)+'\n◽ Account Type: Free\n\n◽ BTC wallet: '
- bot.send_message(call.message.chat.id,msg,reply_markup=markup,parse_mode='html')
- elif call.data == '2':
- db=DBHelper()
- amtt1=db.get_amount()
- if amtt1==[]:
- t=time.time()
- val=0
- db.default_user(t,val)
- p1=db.get_time()
- p=p1[0][0]
- time.sleep(4)
- t=time.time()
- while t-2>p:
- if t-2>p:
- am=db.get_amount()
- val=am[0][0]
- value=val+10
- db.default_user(time.time(),value)
- p1=db.get_time()
- time.sleep(3)
- p=p1[0][0]
- t=time.time()
- markup.row(acct,reg)
- fname=call.message.chat.first_name
- lname=call.message.chat.last_name
- db=DBHelper()
- if lname==None:
- user=fname
- else:
- user=fname+' '+lname
- msg="Well done "+user+" You have registered now your balance will start increasing. Click 'Account' to check your Balance"
- bot.send_message(call.message.chat.id,msg,reply_markup=markup,parse_mode='html')
- bot.polling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement