Skip to content

Latest commit

 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SillyTavern Extension Javascript Runner

This is a simple extension that allows you to run javascript code in the context of the current page.

可用参数如下:

script = {
    eventSource, event_types, ...
}

extensions = {
    getContext, toastr, doExtrasFetch, getApiUrl
}

command = {
    SlashCommandParser, ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument
}

Examples:

script.eventSource.on(script.event_types.MESSAGE_SENT, (data) => {
    const context = extensions.getContext();
    const message = context.chat[context.chat.length-1]
    message.mes = "(bilbilbil~) " + message.mes
    context.chat[context.chat.length-1] = message
    extensions.toastr.success("Message sent !")
})
Screenshot 2024-07-12 at 23 23 55

About

No description, website, or topics provided.

Resources

Stars

36 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages