Ajout de la gestion des informations de stream dans le bot Twitch. Implémentation de la fonction de remplacement des variables de commande pour inclure des informations dynamiques telles que le titre du stream, le nom du jeu, le nombre de viewers et l'uptime. Mise à jour de l'interface utilisateur pour afficher ces informations en temps réel dans la modération Twitch.

This commit is contained in:
2026-03-06 13:48:43 +01:00
parent 876eb1a080
commit 10dd78f630
5 changed files with 273 additions and 49 deletions
+6
View File
@@ -67,9 +67,15 @@ async def checkOnlineStreamer(twitch: Twitch) :
if main_stream:
webapp.config["BOT_STATUS"]["twitch_is_live"] = True
webapp.config["BOT_STATUS"]["twitch_viewer_count"] = getattr(main_stream, 'viewer_count', 0)
webapp.config["BOT_STATUS"]["twitch_stream_title"] = getattr(main_stream, 'title', '') or ''
webapp.config["BOT_STATUS"]["twitch_game_name"] = getattr(main_stream, 'game_name', '') or ''
webapp.config["BOT_STATUS"]["twitch_started_at"] = main_stream.started_at.isoformat() if getattr(main_stream, 'started_at', None) else None
else:
webapp.config["BOT_STATUS"]["twitch_is_live"] = False
webapp.config["BOT_STATUS"]["twitch_viewer_count"] = 0
webapp.config["BOT_STATUS"]["twitch_stream_title"] = ""
webapp.config["BOT_STATUS"]["twitch_game_name"] = ""
webapp.config["BOT_STATUS"]["twitch_started_at"] = None
# Premier check : synchronisation sans notification
if _live_alert_first_check: