Merge pull request #2572 from SillyTavern/theme-command-improvements

/theme allows returning current theme & fix /theme and /bg doc
This commit is contained in:
Cohee
2024-07-28 11:51:41 +03:00
committed by GitHub
2 changed files with 37 additions and 9 deletions

View File

@ -139,9 +139,8 @@ export function initDefaultSlashCommands() {
returns: 'the current background',
unnamedArgumentList: [
SlashCommandArgument.fromProps({
description: 'filename',
description: 'background filename',
typeList: [ARGUMENT_TYPE.STRING],
isRequired: true,
enumProvider: () => [...document.querySelectorAll('.bg_example')]
.map(it => new SlashCommandEnumValue(it.getAttribute('bgfile')))
.filter(it => it.value?.length),
@ -151,12 +150,18 @@ export function initDefaultSlashCommands() {
<div>
Sets a background according to the provided filename. Partial names allowed.
</div>
<div>
If no background is provided, this will return the currently selected background.
</div>
<div>
<strong>Example:</strong>
<ul>
<li>
<pre><code>/bg beach.jpg</code></pre>
</li>
<li>
<pre><code>/bg</code></pre>
</li>
</ul>
</div>
`,