Merge branch 'main' of ssh://gitea.404.mn:2222/ramjm/obed_bot

main
ramjm 7 months ago
commit eb35470954

@ -1,23 +0,0 @@
import schedule
import time
import telebot
from db import *
db = read_db()
bot = telebot.TeleBot(db['token'])
def send_message():
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')
schedule.every().day.at("21:24","Europe/Moscow").do(send_message)
while True:
schedule.run_pending()
time.sleep(1)
Loading…
Cancel
Save