From d74f6791796ce840a56d1f5ca7387f6e5a09b0c0 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 21 Sep 2020 13:50:34 -0700 Subject: [PATCH] fix panic --- api/builtin/mother.ts | 2 +- api/builtin/welcome.ts | 2 +- dist/api/builtin/mother.js | 2 +- dist/api/builtin/mother.js.map | 2 +- dist/api/builtin/welcome.js | 2 +- dist/api/builtin/welcome.js.map | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/builtin/mother.ts b/api/builtin/mother.ts index 569254a..3837be0 100644 --- a/api/builtin/mother.ts +++ b/api/builtin/mother.ts @@ -35,7 +35,7 @@ export function init() { client.login('_', finalAction) client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => { - const arr = message.content.split(' ') + const arr = (message.content && message.content.split(' ')) || [] if (arr.length < 2) return if (arr[0]!=='/bot') return const cmd = arr[1] diff --git a/api/builtin/welcome.ts b/api/builtin/welcome.ts index 213cb97..f5fefe4 100644 --- a/api/builtin/welcome.ts +++ b/api/builtin/welcome.ts @@ -16,7 +16,7 @@ export function init() { client.login('_', finalAction) client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => { - const arr = message.content.split(' ') + const arr = (message.content && message.content.split(' ')) || [] console.log('message.type',message.type) const isGroupJoin = message.type===constants.message_types.group_join if (arr.length < 2 && !isGroupJoin) return diff --git a/dist/api/builtin/mother.js b/dist/api/builtin/mother.js index 8786d3a..a07145e 100644 --- a/dist/api/builtin/mother.js +++ b/dist/api/builtin/mother.js @@ -39,7 +39,7 @@ function init() { const client = new Sphinx.Client(); client.login('_', actions_1.finalAction); client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () { - const arr = message.content.split(' '); + const arr = (message.content && message.content.split(' ')) || []; if (arr.length < 2) return; if (arr[0] !== '/bot') diff --git a/dist/api/builtin/mother.js.map b/dist/api/builtin/mother.js.map index 64dac33..e1df093 100644 --- a/dist/api/builtin/mother.js.map +++ b/dist/api/builtin/mother.js.map @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YACD,OAAO,IAAI,CAAA;SACZ;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"mother.js","sourceRoot":"","sources":["../../../api/builtin/mother.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oDAAoD;AACpD,qCAAoC;AACpC,oDAAoD;AACpD,8CAAgD;AAChD,6BAA4B;AAC5B,wCAAuC;AACvC,kCAAiC;AACjC,sCAAkC;AAClC,2CAA8B;AAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AACjD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAC9E,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,SAAS;CACrB,CAAA;AAED,MAAM,kBAAkB,GAAG;IACzB,SAAS,EAAC;QACR,SAAS,CAAC,aAAa,CAAC,OAAO;QAC/B,SAAS,CAAC,aAAa,CAAC,UAAU;KACnC;CACF,CAAA;AAED,MAAM,eAAe,GAAG;IACtB,OAAO,EAAC,YAAY;IACpB,OAAO,EAAC,SAAS;CAClB,CAAA;AAED,SAAgB,IAAI;IAElB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAA;IAClC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,qBAAW,CAAC,CAAA;IAE9B,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,CAAO,OAAuB,EAAE,EAAE;QAC7D,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO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GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;YACxB,IAAG,CAAC,IAAE,CAAC,CAAC,IAAI,IAAE,CAAC,CAAC,YAAY,EAAE;gBAC5B,OAAO,CAAC,CAAA;aACT;YACD,OAAO,IAAI,CAAA;SACZ;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/api/builtin/welcome.js b/dist/api/builtin/welcome.js index 68a05c9..346b0aa 100644 --- a/dist/api/builtin/welcome.js +++ b/dist/api/builtin/welcome.js @@ -23,7 +23,7 @@ function init() { const client = new Sphinx.Client(); client.login('_', actions_1.finalAction); client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () { - const arr = message.content.split(' '); + const arr = (message.content && message.content.split(' ')) || []; console.log('message.type', message.type); const isGroupJoin = message.type === constants.message_types.group_join; if (arr.length < 2 && !isGroupJoin) diff --git a/dist/api/builtin/welcome.js.map b/dist/api/builtin/welcome.js.map index f3e581b..f85d908 100644 --- a/dist/api/builtin/welcome.js.map +++ b/dist/api/builtin/welcome.js.map @@ -1 +1 @@ -{"version":3,"file":"welcome.js","sourceRoot":"","sources":["../../../api/builtin/welcome.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAAoC;AACpC,oDAAoD;AACpD,sCAAkC;AAClC,6BAA4B;AAC5B,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAE9E,IAAI,OAAO,GAAG,KAAK,CAAA;AAEnB,SAAgB,IAAI;IAClB,IAAG,OAAO;QAAE,OAAM;IAClB,OAAO,GAAG,IAAI,CAAA;IAEd,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAA;IAClC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,qBAAW,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