mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-03 04:37:40 +01:00
Add check for closure type
This commit is contained in:
parent
de8732fad6
commit
e48ff8daae
@ -2240,7 +2240,11 @@ async function echoCallback(args, value) {
|
||||
options.onHidden = () => resolveToastDismissal(value);
|
||||
}
|
||||
if (args.onClick) {
|
||||
options.onclick = () => args.onClick.execute();
|
||||
if (args.onClick instanceof SlashCommandClosure) {
|
||||
options.onclick = () => args.onClick.execute();
|
||||
} else {
|
||||
toastr.warning('Invalid onClick provided for /echo command. This is not a closure');
|
||||
}
|
||||
}
|
||||
|
||||
let toast;
|
||||
|
Loading…
x
Reference in New Issue
Block a user