feat: add optional custom argument topic override via Web UI
- Added optional 'topic' field to BipolarTriggerRequest model - Added topic parameter to force_trigger_argument and force_trigger_argument_from_message_id - Updated run_argument to accept optional custom topic (None=random, ''=no topic, str=custom) - Added topic input field to Web UI trigger-argument section - Updated JS to send topic in API request body - Custom topics bypass the random rotation system, allowing manual theme control
This commit is contained in:
@@ -249,6 +249,7 @@ async function triggerBipolarArgument() {
|
||||
const channelIdInput = document.getElementById('bipolar-channel-id').value.trim();
|
||||
const messageIdInput = document.getElementById('bipolar-message-id').value.trim();
|
||||
const context = document.getElementById('bipolar-context').value;
|
||||
const topic = document.getElementById('bipolar-topic').value.trim();
|
||||
const statusDiv = document.getElementById('bipolar-status');
|
||||
|
||||
if (!channelIdInput) {
|
||||
@@ -278,6 +279,10 @@ async function triggerBipolarArgument() {
|
||||
requestBody.message_id = messageIdInput;
|
||||
}
|
||||
|
||||
if (topic) {
|
||||
requestBody.topic = topic;
|
||||
}
|
||||
|
||||
const result = await apiCall('/bipolar-mode/trigger-argument', 'POST', requestBody);
|
||||
|
||||
if (result.status === 'error') {
|
||||
@@ -290,6 +295,7 @@ async function triggerBipolarArgument() {
|
||||
showNotification(`⚔️ Argument triggered!`);
|
||||
|
||||
document.getElementById('bipolar-context').value = '';
|
||||
document.getElementById('bipolar-topic').value = '';
|
||||
document.getElementById('bipolar-message-id').value = '';
|
||||
|
||||
loadActiveArguments();
|
||||
|
||||
Reference in New Issue
Block a user