multi-task-widget-cross-pla.../scripts/index.js
2024-05-03 21:43:02 +08:00

30 lines
696 B
JavaScript

let params = {};
function respond(template, params) {
Object.keys(params).forEach((key) => {
template = template.replace(`{${key}}`, params[key]);
});
ComfyJS.Say(template);
}
function isMod(flags) {
return flags.broadcaster || flags.mod;
}
function isStreamer(flags) {
return flags.broadcaster;
}
ComfyJS.onCommand = (user, command, message, flags, extra) => {
command = `!${command.toLowerCase()}`;
processCommand(user, command, message, flags, extra);
};
const oauth_token = auth.oauth.includes("oauth:")
? auth.oauth
: `oauth:${auth.oauth}`;
const auth_username = auth.username ? auth.username : auth.channel;
ComfyJS.Init(auth_username, `${oauth_token}`, [auth.channel]);