You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
from datetime import datetime
|
|
|
|
import time
|
|
|
|
import telebot
|
|
|
|
from db import *
|
|
|
|
db = read_db()
|
|
|
|
bot = telebot.TeleBot(db['token'])
|
|
|
|
while True:
|
|
|
|
now = datetime.now()
|
|
|
|
current_time = now.strftime("%H:%M")
|
|
|
|
if current_time == "21:00":
|
|
|
|
db = read_db()
|
|
|
|
for i in db:
|
|
|
|
if i != "token":
|
|
|
|
text = 'Статистика обедов за 24 часа::\n'
|
|
|
|
for j in i:
|
|
|
|
text += f'<a href="tg://user?id={j}">Пользователь</a>: {db[i][j]} обедов.\n'
|
|
|
|
db[i][j] = 0
|
|
|
|
write_db(db)
|
|
|
|
bot.send_message(int(i),
|
|
|
|
text,
|
|
|
|
parse_mode='HTML')
|
|
|
|
time.sleep(61)
|