TGBOTSTAT เป็นแพ็คเกจ Python ที่ให้คุณติดตามและบันทึกสถิติสำหรับการใช้ Bot Telegram ของคุณ มันสามารถบันทึกจำนวนการใช้งานของแต่ละคำสั่งซื้อผู้ใช้ที่ใช้คำสั่งเหล่านี้ชั่วโมงที่ใช้คำสั่งและอื่น ๆ
คุณสามารถติดตั้ง tgbotstat โดยใช้ pip ตรวจสอบให้แน่ใจว่าคุณติดตั้ง pip แล้วเรียกใช้คำสั่งต่อไปนี้:
pip install tgbotstatเมื่อคุณติดตั้ง tgbotstat แล้วคุณสามารถนำเข้าลงในรหัส 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 )นอกจากนี้คุณยังสามารถใช้ฟังก์ชั่นและคลาสอื่น ๆ ที่เปิดเผยโดยแพ็คเกจเช่น loading_utilizers , save_utilizer , plulf_commandes_popular ฯลฯ เพื่อปรับแต่งสถิติของคุณตามความต้องการของคุณ
ยินดีต้อนรับ! หากคุณต้องการปรับปรุง TGBOTSTAT หรือเพิ่มคุณสมบัติใหม่อย่าลังเลที่จะเปิดคำขอการสกัด (คำขอเสื้อกันหนาว) หรือปัญหารายงาน (จาก) บน https://github.com/codingtoto/tgbotstat
เราวางแผนที่จะเพิ่มคุณสมบัติและการปรับปรุงให้กับ tgbotstat ในรุ่นอนาคต นี่คือภาพรวมของงานที่วางแผนไว้:
เราเปิดรับข้อเสนอแนะและการมีส่วนร่วมของชุมชน หากคุณมีแนวคิดการปรับปรุงหรือคุณสมบัติใหม่ที่คุณต้องการดูใน tgbotstat อย่าลังเลที่จะเปิดทางออกหรือเสนอคำขอสำหรับการซ่อมแซม GitHub ของเรา
อย่าลังเลที่จะติดตามการพัฒนาของเราและมีส่วนร่วมในการปรับปรุงแพ็คเกจนี้ เราแทบรอไม่ไหวที่จะเห็นว่า tgbotstat จะพัฒนาไปอย่างไรในอนาคต!
โครงการนี้อยู่ภายใต้ใบอนุญาต MIT สำหรับข้อมูลเพิ่มเติมดูไฟล์ใบอนุญาต