Several million refactoring of existing slash commands with enums (really)

This commit is contained in:
Wolfsblvt
2024-06-17 07:04:10 +02:00
parent 6f7ef25369
commit 66d609c35f
15 changed files with 332 additions and 132 deletions

View File

@@ -123,6 +123,7 @@ async function doCount() {
//toastr success with the token count of the chat
const count = await getTokenCountAsync(allMessages);
toastr.success(`Token count: ${count}`);
return count;
}
jQuery(() => {
@@ -134,7 +135,7 @@ jQuery(() => {
$('#extensionsMenu').prepend(buttonHtml);
$('#token_counter').on('click', doTokenCounter);
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'count',
callback: doCount,
callback: async () => String(await doCount()),
returns: 'number of tokens',
helpString: 'Counts the number of tokens in the current chat.',
}));