Move openai slash commands to init function
This commit is contained in:
parent
b80ed958ae
commit
63a0ebb885
|
@ -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();
|
||||
|
|
|
@ -4679,22 +4679,23 @@ function runProxyCallback(_, value) {
|
|||
return foundName;
|
||||
}
|
||||
|
||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||
name: 'proxy',
|
||||
callback: runProxyCallback,
|
||||
returns: 'current proxy',
|
||||
namedArgumentList: [],
|
||||
unnamedArgumentList: [
|
||||
SlashCommandArgument.fromProps({
|
||||
description: 'name',
|
||||
typeList: [ARGUMENT_TYPE.STRING],
|
||||
isRequired: true,
|
||||
enumProvider: () => proxies.map(preset => new SlashCommandEnumValue(preset.name, preset.url)),
|
||||
}),
|
||||
],
|
||||
helpString: 'Sets a proxy preset by name.',
|
||||
}));
|
||||
|
||||
export function initOpenai() {
|
||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||
name: 'proxy',
|
||||
callback: runProxyCallback,
|
||||
returns: 'current proxy',
|
||||
namedArgumentList: [],
|
||||
unnamedArgumentList: [
|
||||
SlashCommandArgument.fromProps({
|
||||
description: 'name',
|
||||
typeList: [ARGUMENT_TYPE.STRING],
|
||||
isRequired: true,
|
||||
enumProvider: () => proxies.map(preset => new SlashCommandEnumValue(preset.name, preset.url)),
|
||||
}),
|
||||
],
|
||||
helpString: 'Sets a proxy preset by name.',
|
||||
}));
|
||||
}
|
||||
|
||||
$(document).ready(async function () {
|
||||
$('#test_api_button').on('click', testApiConnection);
|
||||
|
|
Loading…
Reference in New Issue