mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Inject supports variables for ID
This commit is contained in:
@ -1251,9 +1251,17 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
|||||||
name: 'inject',
|
name: 'inject',
|
||||||
callback: injectCallback,
|
callback: injectCallback,
|
||||||
namedArgumentList: [
|
namedArgumentList: [
|
||||||
new SlashCommandNamedArgument(
|
SlashCommandNamedArgument.fromProps({
|
||||||
'id', 'injection ID', [ARGUMENT_TYPE.STRING], true,
|
name: 'id',
|
||||||
),
|
description: 'injection ID or variable name pointing to ID',
|
||||||
|
typeList: [ARGUMENT_TYPE.STRING, ARGUMENT_TYPE.VARIABLE_NAME],
|
||||||
|
isRequired: true,
|
||||||
|
|
||||||
|
enumProvider: () => [
|
||||||
|
...commonEnumProviders.injects(),
|
||||||
|
...commonEnumProviders.variables('all')().map(x => { x.description = 'Variable'; return x; }),
|
||||||
|
],
|
||||||
|
}),
|
||||||
new SlashCommandNamedArgument(
|
new SlashCommandNamedArgument(
|
||||||
'position', 'injection position', [ARGUMENT_TYPE.STRING], false, false, 'after', ['before', 'after', 'chat'],
|
'position', 'injection position', [ARGUMENT_TYPE.STRING], false, false, 'after', ['before', 'after', 'chat'],
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user