TGBOTSTAT 는 Telegram Bot을 사용하기위한 통계를 따르고 저장할 수있는 Python 패키지입니다. 각 주문의 사용 수, 이러한 명령을 사용한 사용자, 명령이 사용되는 시간 등을 저장할 수 있습니다.
pip 사용하여 TGBOTSTAT를 설치할 수 있습니다. pip 설치 한 다음 다음 명령을 실행하십시오.
pip install tgbotstatTGBOTSTAT를 설치 한 후에는 Python 코드로 가져와 사용 통계를 모니터링하고 저장할 수 있습니다. 프로젝트에서 사용하는 방법은 다음과 같습니다.
from tgbotstat import *
# Charger les statistiques existantes
statistiques = charger_statistiques ()
# Mettre à jour les statistiques pour une commande
commande = "/start"
user_id = 12345
heure_commande = "14"
jour_semaine = "Lundi"
mettre_a_jour_statistiques_commande ( statistiques , commande , user_id , heure_commande , jour_semaine )
# Enregistrer de nouvelles statistiques
sauvegarder_statistiques ( statistiques )
# Afficher les données d'utilisation
stats_text = "Statistiques d'utilisation des commandes: n "
for date , commands in statistiques [ 'commands' ]. items ():
stats_text += f" n Date: { date } n "
for command , data in commands . items ():
nombre_utilisations = data [ 'nombre_utilisations' ]
utilisateurs_commande = len ( data [ 'utilisateurs' ])
heures = data . get ( 'heures' , {})
heures_text = ', ' . join ([ f" { heure } : { utilisations } utilisations" for heure , utilisations in heures . items ()])
stats_text += f"- { command } : { nombre_utilisations } utilisations par { utilisateurs_commande } utilisateurs ( { heures_text } ) n "
print ( stats_text )로드 _utilizers , save_utilizer , follow_commandes_popular 등과 같은 패키지에서 노출 된 다른 기능 및 클래스를 사용하여 필요에 따라 통계를 개인화 할 수 있습니다.
기부금을 환영합니다! TGBOTSTAT를 개선하거나 새로운 기능을 추가하려면 https://github.com/codingtoto/tgbotstat에서 추출 요청 (요청 스웨터) 또는 문제를보고하십시오.
우리는 향후 버전에서 tgbotstat 에 몇 가지 기능과 개선 사항을 추가 할 계획입니다. 다음은 계획된 작업에 대한 개요입니다.
우리는 지역 사회 제안과 기여에 개방되어 있습니다. tgbotstat 에서보고 싶은 개선 아이디어 나 새로운 기능이있는 경우 망설이지 말고 길을 열거 나 Restitory Github에 대한 요청을 제공하십시오.
우리의 개발을 따르고이 패키지 개선에 기여하는 것을 망설이지 마십시오. 우리는 tgbotstat 앞으로 어떻게 발전 할 것인지 기다릴 수 없습니다!
이 프로젝트는 MIT 라이센스 아래에 있습니다. 자세한 내용은 라이센스 파일을 참조하십시오.