From 15c5fffb087a4231506048c6c2c77c7d9ee0082d Mon Sep 17 00:00:00 2001 From: encrypt Date: Thu, 16 Apr 2020 21:47:39 +0200 Subject: [PATCH] aggiunti messaggi --- mumble-bot/bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mumble-bot/bot.py b/mumble-bot/bot.py index 0c6498f..3e01497 100644 --- a/mumble-bot/bot.py +++ b/mumble-bot/bot.py @@ -15,9 +15,11 @@ def message_received(message): if command == "/start": is_streaming = True silence_time = 0 + mumble.my_channel().send_text_message("Diretta iniziata") mumble.users.myself.recording() elif command == "/stop": is_streaming = False + mumble.my_channel().send_text_message("Diretta terminata") mumble.users.myself.unrecording() parser = argparse.ArgumentParser(description='Regia pienamente automatizzata') @@ -95,8 +97,9 @@ while mumble.is_alive(): silence_time += RESOLUTION sys.stdout.buffer.write(silent) - if auto_suspend_stream and (silence_time >= silence_limit_ms): + if auto_suspend_stream and (silence_time >= silence_limit_ms) and is_streaming: is_streaming = False + mumble.my_channel().send_text_message("Diretta terminata in automatico dopo "+str(silence_limit)+" secondi circa di silenzio") mumble.users.myself.unrecording() cursor_time += FLOAT_RESOLUTION