added global statistics

This commit is contained in:
huker667 committed 2026-05-23 18:09:50 +03:00
1 parent f9207e1f99
commit 8861fbbb4b
5 files changed
+91

No files matched your search

+9
View File
@@ -27,6 +27,7 @@ from aiogram.types import (
Message,
)
from callbacks import *
from statistics import *
from colors import *
from commands import *
from dotenv import load_dotenv
@@ -170,6 +171,7 @@ async def guest_middleware(handler, event, data):
user_id=user_id,
message_id=None,
)
add_one_to("stats/guest")
try:
await data["bot"](
AnswerGuestQuery(
@@ -434,6 +436,8 @@ async def chosen_inline_result_handler(chosen_result: ChosenInlineResult):
inline_message_id = chosen_result.inline_message_id
user_id = chosen_result.from_user.id
add_one_to("stats/inline")
if chosen_result.query == "clear":
user_contexts[user_id] = []
else:
@@ -485,6 +489,11 @@ async def chosen_inline_result_handler(chosen_result: ChosenInlineResult):
async def main():
ensure_path("stats/gens")
ensure_path("stats/inline")
ensure_path("stats/guest")
ensure_path("stats/ben")
ensure_path("stats/reporn")
await bot.delete_webhook(drop_pending_updates=True)
await dp.start_polling(
bot,