Move openai slash commands to init function

This commit is contained in:
Wolfsblvt 2024-07-11 22:43:25 +02:00
parent b80ed958ae
commit 63a0ebb885
2 changed files with 19 additions and 16 deletions

View File

@ -101,6 +101,7 @@ import {
proxies,
loadProxyPresets,
selected_proxy,
initOpenai,
} from './scripts/openai.js';
import {
@ -915,6 +916,7 @@ async function firstLoadInit() {
initKeyboard();
initDynamicStyles();
initTags();
initOpenai();
await getUserAvatars(true, user_avatar);
await getCharacters();
await getBackgrounds();

View File

@ -4679,6 +4679,7 @@ function runProxyCallback(_, value) {
return foundName;
}
export function initOpenai() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'proxy',
callback: runProxyCallback,
@ -4694,7 +4695,7 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
],
helpString: 'Sets a proxy preset by name.',
}));
}
$(document).ready(async function () {
$('#test_api_button').on('click', testApiConnection);