diff --git a/lily.user.js b/lily.user.js index 2fd2e49..c926239 100644 --- a/lily.user.js +++ b/lily.user.js @@ -51,7 +51,7 @@ } /** @type {LILY.Belt} */ const Belt = { admins: [71_240, 67_994], - cli: {'!LILY': { + cli: {'#LILY': { status: _ => '200 OK', box: { on: _ => Box.enable(), @@ -67,7 +67,6 @@ /** @type {LILY.Belt['is_cb']} */ is_cb: s => typeof s === 'function', run(tokens) { /** @type {string | undefined} */ let t, /** @type {LILY.Commands | LILY.CommandCB} */ cmd = this.cli while (t = tokens.shift()) if (U.with(cmd[t], next => !next || this.is_cb(cmd = next))) break // eslint-disable-line no-cond-assign - // either t is undefined, or cmd[t] is undefined or cmd is a function if (!this.is_cb(cmd)) return t ? `unknown token ${t}` : `subcommands: [${Object.keys(cmd).join(', ')}]` return U.with(cmd(...tokens), r => typeof r === 'boolean' ? (r ? 'success' : 'fail') : String(r)) }, @@ -78,5 +77,5 @@ } SDK.hookFunction('SpeechTransformGagGarble', 0, ([text]) => text) // disable garbling SDK.hookFunction('ChatRoomSendChatMessage', 0, (na, n) => Box.enabled ? n(na) : Boolean(W.ChatRoomSendLocal('You try to talk, but nothing comes out.'))) - W.ChatRoomRegisterMessageHandler({Priority: -169, Description: 'LILY', Callback: data => data.Type === 'Whisper' && data.Content.startsWith('!LILY') && (Belt.receive(data) || true)}) + W.ChatRoomRegisterMessageHandler({Priority: -169, Description: 'LILY', Callback: data => data.Type === 'Whisper' && data.Content.startsWith('#LILY') && (Belt.receive(data) || true)}) })()