tgbotstat
1.0.0
TGBOTSTAT是一個Python軟件包,可讓您關注並保存使用電報機器人的統計信息。它可以節省每個訂單的用途,使用這些命令的用戶,使用命令的小時等等。
您可以使用pip安裝TGBOTSTAT 。確保已安裝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 , laste_commandes_popular等,根據您的需求個性化您的統計信息。
歡迎捐款!如果要改善TGBOTSTAT或添加新功能,請隨時在https://github.com/codingtoto/tgbotstat上打開提取請求(請求毛衣)或報告問題。
我們計劃在未來版本中為tgbotstat添加一些功能和改進。這是計劃中的工作的概述:
我們對社區建議和貢獻開放。如果您想在tgbotstat中看到改進的想法或新功能,請隨時開放出路或為我們的Restory Github提供請求。
請不要猶豫,遵循我們的發展,並為改進此包裝做出貢獻。我們迫不及待地想看看tgbotstat將來會如何發展!
該項目符合MIT許可。有關更多信息,請參閱許可證文件。