fix: merge context + topic into single field — one clear purpose

- Removed separate 'topic' field from BipolarTriggerRequest model
- Removed topic parameter from force_trigger_argument, force_trigger_argument_from_message_id, and run_argument
- trigger_context now doubles as the argument theme: if provided by user, it becomes the topic;
  if blank, a random topic is selected from the rotation pool
- Web UI: replaced two confusing fields (Context + Topic) with one clear field labeled
  'What should they argue about? (optional)' with a plain-English description
- JS: removed topic field reference, context.trim() ensures empty strings aren't sent
This commit is contained in:
2026-04-30 12:30:49 +03:00
parent 846557fa96
commit e6c818f647
5 changed files with 23 additions and 43 deletions

View File

@@ -129,7 +129,7 @@ def trigger_argument(data: BipolarTriggerRequest):
if message_id:
async def trigger_from_message():
success, error = await force_trigger_argument_from_message_id(
channel_id, message_id, globals.client, data.context, topic=data.topic
channel_id, message_id, globals.client, data.context
)
if not success:
logger.error(f"Failed to trigger argument from message: {error}")
@@ -148,8 +148,8 @@ def trigger_argument(data: BipolarTriggerRequest):
if not channel:
return JSONResponse(status_code=404, content={"status": "error", "message": f"Channel {channel_id} not found"})
# Trigger the argument with optional custom topic
globals.client.loop.create_task(force_trigger_argument(channel, globals.client, data.context, topic=data.topic))
# Trigger the argument — context doubles as the argument theme
globals.client.loop.create_task(force_trigger_argument(channel, globals.client, data.context))
return {
"status": "ok",

View File

@@ -45,8 +45,7 @@ class LogFilterUpdateRequest(BaseModel):
class BipolarTriggerRequest(BaseModel):
channel_id: str # String to handle large Discord IDs from JS
message_id: str = None # Optional: starting message ID (string)
context: str = ""
topic: str = "" # Optional: custom argument topic (overrides random topic selection)
context: str = "" # Optional: argument theme/context — tells them what to argue about
class ManualCropRequest(BaseModel):