Untested Phase 1 (Foundation & Resource management) of voice chat integration
This commit is contained in:
@@ -28,6 +28,31 @@ MIN_EXCHANGES = 4 # Minimum number of back-and-forth exchanges before ending ca
|
||||
ARGUMENT_TRIGGER_CHANCE = 0.15 # 15% chance for the other Miku to break through
|
||||
DELAY_BETWEEN_MESSAGES = (2.0, 5.0) # Random delay between argument messages (seconds)
|
||||
|
||||
# Pause state for voice sessions
|
||||
_bipolar_interactions_paused = False
|
||||
|
||||
# ============================================================================
|
||||
# VOICE SESSION PAUSE/RESUME
|
||||
# ============================================================================
|
||||
|
||||
def pause_bipolar_interactions():
|
||||
"""Pause all bipolar interactions (called during voice sessions)"""
|
||||
global _bipolar_interactions_paused
|
||||
_bipolar_interactions_paused = True
|
||||
logger.info("Bipolar interactions paused")
|
||||
|
||||
|
||||
def resume_bipolar_interactions():
|
||||
"""Resume bipolar interactions (called after voice sessions)"""
|
||||
global _bipolar_interactions_paused
|
||||
_bipolar_interactions_paused = False
|
||||
logger.info("Bipolar interactions resumed")
|
||||
|
||||
|
||||
def is_bipolar_paused():
|
||||
"""Check if bipolar interactions are currently paused"""
|
||||
return _bipolar_interactions_paused
|
||||
|
||||
# ============================================================================
|
||||
# STATE PERSISTENCE
|
||||
# ============================================================================
|
||||
@@ -1039,6 +1064,11 @@ async def maybe_trigger_argument(channel: discord.TextChannel, client, context:
|
||||
if not globals.BIPOLAR_MODE:
|
||||
return False
|
||||
|
||||
# Check if bipolar interactions are paused (voice session)
|
||||
if is_bipolar_paused():
|
||||
logger.debug("Bipolar argument blocked (voice session active)")
|
||||
return False
|
||||
|
||||
if is_argument_in_progress(channel.id):
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user