Only try to update presence and transmit when the bot is online
This commit is contained in:
@@ -334,7 +334,8 @@ async def mqtt_lifecycle_manager():
|
|||||||
await stop_recording()
|
await stop_recording()
|
||||||
|
|
||||||
# Stop Discord Transmission
|
# Stop Discord Transmission
|
||||||
discord_bot.stop_transmission()
|
if discord_bot.is_ready():
|
||||||
|
discord_bot.stop_transmission()
|
||||||
|
|
||||||
audio_url = None
|
audio_url = None
|
||||||
if current_call_id:
|
if current_call_id:
|
||||||
@@ -355,8 +356,9 @@ async def mqtt_lifecycle_manager():
|
|||||||
LOGGER.debug(f"Call Start: TGID {current_tgid} ({current_meta.get('alpha_tag')})")
|
LOGGER.debug(f"Call Start: TGID {current_tgid} ({current_meta.get('alpha_tag')})")
|
||||||
|
|
||||||
# Trigger Discord Transmission
|
# Trigger Discord Transmission
|
||||||
discord_bot.start_transmission()
|
if discord_bot.is_ready():
|
||||||
discord_bot.update_system_presence(current_meta.get('sysname', 'Scanning'))
|
discord_bot.start_transmission()
|
||||||
|
discord_bot.update_system_presence(current_meta.get('sysname', 'Scanning'))
|
||||||
|
|
||||||
# Generate ID
|
# Generate ID
|
||||||
start_ts = int(now.timestamp())
|
start_ts = int(now.timestamp())
|
||||||
@@ -396,7 +398,8 @@ async def mqtt_lifecycle_manager():
|
|||||||
await stop_recording()
|
await stop_recording()
|
||||||
|
|
||||||
# Stop Discord Transmission
|
# Stop Discord Transmission
|
||||||
discord_bot.stop_transmission()
|
if discord_bot.is_ready():
|
||||||
|
discord_bot.stop_transmission()
|
||||||
|
|
||||||
audio_url = None
|
audio_url = None
|
||||||
if current_call_id:
|
if current_call_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user