mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Move openai slash commands to init function
This commit is contained in:
@@ -101,6 +101,7 @@ import {
|
|||||||
proxies,
|
proxies,
|
||||||
loadProxyPresets,
|
loadProxyPresets,
|
||||||
selected_proxy,
|
selected_proxy,
|
||||||
|
initOpenai,
|
||||||
} from './scripts/openai.js';
|
} from './scripts/openai.js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -915,6 +916,7 @@ async function firstLoadInit() {
|
|||||||
initKeyboard();
|
initKeyboard();
|
||||||
initDynamicStyles();
|
initDynamicStyles();
|
||||||
initTags();
|
initTags();
|
||||||
|
initOpenai();
|
||||||
await getUserAvatars(true, user_avatar);
|
await getUserAvatars(true, user_avatar);
|
||||||
await getCharacters();
|
await getCharacters();
|
||||||
await getBackgrounds();
|
await getBackgrounds();
|
||||||
|
@@ -4679,7 +4679,8 @@ function runProxyCallback(_, value) {
|
|||||||
return foundName;
|
return foundName;
|
||||||
}
|
}
|
||||||
|
|
||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
export function initOpenai() {
|
||||||
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
name: 'proxy',
|
name: 'proxy',
|
||||||
callback: runProxyCallback,
|
callback: runProxyCallback,
|
||||||
returns: 'current proxy',
|
returns: 'current proxy',
|
||||||
@@ -4693,8 +4694,8 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
helpString: 'Sets a proxy preset by name.',
|
helpString: 'Sets a proxy preset by name.',
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(async function () {
|
$(document).ready(async function () {
|
||||||
$('#test_api_button').on('click', testApiConnection);
|
$('#test_api_button').on('click', testApiConnection);
|
||||||
|
Reference in New Issue
Block a user