listen chat

This commit is contained in:
Foufure13
2025-02-21 00:53:38 +01:00
parent ddbac35391
commit fc45df9799
10 changed files with 202 additions and 47 deletions
+24 -12
View File
@@ -31,6 +31,7 @@ from fonction.first_class import RecordTwitch
from fonction.first_class import Subtitle_translation
from fonction.first_class import IA_generator
from fonction.first_class import messageTwitch
from fonction.first_class import TwitchChatBot
#import from local file secondary fonction
from fonction.second_fonction import *
@@ -45,10 +46,16 @@ console = Console()
def stop_all():
hprint("blue", "Arrêt du bot twitch.")
recordTw.stop()
sb_translation.stop()
ask_text.stop()
controluser.stop()
if 'recordTw' in globals() and recordTw:
recordTw.stop()
if 'bot' in globals() and bot:
bot.stop()
if 'sb_translation' in globals() and sb_translation:
sb_translation.stop()
if 'ask_text' in globals() and ask_text:
ask_text.stop()
if 'controluser' in globals() and controluser:
controluser.stop()
def print_help():
hprint("PURPLE", "Touche 'F5'BOT Active l'écoute clavier")
@@ -184,16 +191,21 @@ if __name__ == '__main__':
recordTw = RecordTwitch(channel_name=args.twitchname, record_time=args.recordtime)
recordTw.main()
hprint("blue", "start loop Subtitle_translation")
sb_translation = Subtitle_translation("../config/config.json")
sb_translation.start_main_loop()
#lancement d'enregistrement chat du stream
hprint("blue", "start loop TwitchChatBot")
bot = TwitchChatBot(args.twitchname)
bot.start()
hprint("blue", "start loop IA_generator")
ask_text = IA_generator("../config/config.json")
ask_text.start_main_loop()
# hprint("blue", "start loop Subtitle_translation")
# sb_translation = Subtitle_translation("../config/config.json")
# sb_translation.start_main_loop()
controluser = messageTwitch("../config/user.json",args.twitchname)
controluser.start_loop_respond()
# hprint("blue", "start loop IA_generator")
# ask_text = IA_generator("../config/config.json")
# ask_text.start_main_loop()
# controluser = messageTwitch("../config/user.json",args.twitchname)
# controluser.start_loop_respond()
print_help()
listener_thread = threading.Thread(target=start_keyboard_listener)