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…
Reference in New Issue