import telebot
import sqlite3
import random
import string
import time
import re
import requests
import os
from telebot import types
from datetime import datetime
import sqlite
import threading
from threading import Thread
import asyncio
bot = telebot.TeleBot(token='ТОКЕН')
db = sqlite3.connect('baza.db', check_same_thread=False)
tk = sqlite3.connect('token.db', check_same_thread=False)
cursor = db.cursor()
trsor = tk.cursor()
master_id = 1110551
startklava = types.ReplyKeyboardMarkup(resize_keyboard=True, one_time_keyboard=True, row_width=2)
button1 = types.KeyboardButton(text='Понятие')
button2 = types.KeyboardButton(text='О боте')
button3 = types.KeyboardButton(text='Личный кабинет')
startklava.add(button1, button2, button3)
def yes_check(status):
global info
info = status
def get_operator(phone):
params = {'get_operator': '1', 'login': 'sster', 'psw': 'Ncm@F!vLGf', 'phone': phone, 'fmt': '3'}
global o
o = requests.get('https://smsc.ru/sys/info.php', params)
o
def egz_checkden():
svv = sqlite.GetInfo()
svv.get_okdata()
itt = sqlite.itt
d = datetime.now()
date = d.strftime('%d.%m.%Y')
print(221)
for x in itt:
if x[4] < date:
svv.useer_id = x[1]
svv.udal_subs()
with open(os.path.abspath(os.getcwd()) + '\HistorySubs\\' + x[1] + '.txt', 'a+') as file:
if x[5] == '0':
file.write(f'User ID: {x[1]}\nUsername: {x[2]}\nData Start: {x[3]}\nData End: {x[4]}\nProdlen: No\nLimit Token: {x[7]}\n\n')
file.close()
else:
file.write(f'User ID: {x[1]}\nUsername: {x[2]}\nData Start: {x[3]}\nData End: {x[4]}\nProdlen: Yes\nKolvo Prodlen: {x[6]}\nLimit Token: {x[7]}\n\n')
file.close()
time.sleep(86400)
egz_checkden()
Thread(target=egz_checkden(), args=())
chckden.start()
print('super')
def check_freeze(resu):
global resuy
resuy = resu
def genstop(message):
if message.text == 'TINKOFF GAVNO':
bot.send_message(message.chat.id, '*Бот остановлен принудительно!*', parse_mode='Markdown')
dob_bot_zapis(message, 'Бот остановлен принудительно!')
raise UserWarning
else:
bot.send_message(message.chat.id, '*Кодовое слово отвратительно!*', parse_mode='Markdown')
dob_bot_zapis(message, 'Кодовое слово отвратительно!')