| 9180 | 9180 | helpString: 'Closes the current chat.', |
| 9181 | 9181 | })); |
| 9182 | 9182 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 9183 | + name: 'tempchat', |
| 9184 | + callback: async () => { |
| 9185 | + return new Promise((resolve, reject) => { |
| 9186 | + const eventCallback = async (chatId) => { |
| 9187 | + if (chatId) { |
| 9188 | + return reject('Not in a temporary chat'); |
| 9189 | + } |
| 9190 | + await newAssistantChat(); |
| 9191 | + return resolve(''); |
| 9192 | + }; |
| 9193 | + eventSource.once(event_types.CHAT_CHANGED, eventCallback); |
| 9194 | + doCloseChat(); |
| 9195 | + setTimeout(() => { |
| 9196 | + reject('Failed to open temporary chat'); |
| 9197 | + eventSource.removeListener(event_types.CHAT_CHANGED, eventCallback); |
| 9198 | + }, debounce_timeout.relaxed); |
| 9199 | + }); |
| 9200 | + }, |
| 9201 | + helpString: 'Opens a temporary chat with Assistant.', |
| 9202 | + })); |
| 9203 | + SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 9183 | 9204 | name: 'panels', |
| 9184 | 9205 | callback: doTogglePanels, |
| 9185 | 9206 | aliases: ['togglepanels'], |