longhorn09 / lorebot

Discord lorebot in support of Arctic text-based RPG
MIT License
7 stars 9 forks source link

more graceful handling of malformed !query #17

Open longhorn09 opened 7 years ago

longhorn09 commented 7 years ago
 72 2017-07-20 08:29:36 : Kog (Vladimir)                 !query effects=immune_negative_energy
 73 /home/ntang/lorebot/lorebot.js:1102
 74                 if (args[property].trim().indexOf(' by ') > 0) {       // !query affects=damroll by 2,hitroll by 2
 75                                    ^
 76
 77 TypeError: args[property].trim is not a function
 78     at ProcessQuery (/home/ntang/lorebot/lorebot.js:1102:36)
 79     at Client.client.on (/home/ntang/lorebot/lorebot.js:1431:9)
 80     at emitOne (events.js:96:13)
 81     at Client.emit (events.js:191:7)
 82     at MessageCreateHandler.handle (/home/ntang/lorebot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
 83     at WebSocketPacketManager.handle (/home/ntang/lorebot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:102:65)
 84     at WebSocketConnection.onPacket (/home/ntang/lorebot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:325:35)
 85     at WebSocketConnection.onMessage (/home/ntang/lorebot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:288:17)
 86     at WebSocket.onMessage (/home/ntang/lorebot/node_modules/ws/lib/EventTarget.js:103:16)
 87     at emitTwo (events.js:106:13)
 88     at WebSocket.emit (events.js:194:7)
 89 error: Forever detected script exited with code: 1
 90 error: Script restart attempt #1
 91 Lorebot ready!
 92 2017-07-20 08:31:52 : Kog (Vladimir)                 !query effects=immune_negative_energy
longhorn09 commented 7 years ago
 94 2017-07-20 08:32:12 : Kog (Vladimir)                 !query affects=str&dex
 95 /home/ntang/lorebot/lorebot.js:1102
 96                 if (args[property].trim().indexOf(' by ') > 0) {       // !query affects=damroll by 2,hitroll by 2
 97                                    ^
 98
 99 TypeError: args[property].trim is not a function
100     at ProcessQuery (/home/ntang/lorebot/lorebot.js:1102:36)
101     at Client.client.on (/home/ntang/lorebot/lorebot.js:1431:9)
102     at emitOne (events.js:96:13)
103     at Client.emit (events.js:191:7)
104     at MessageCreateHandler.handle (/home/ntang/lorebot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
105     at WebSocketPacketManager.handle (/home/ntang/lorebot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:102:65)
106     at WebSocketConnection.onPacket (/home/ntang/lorebot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:325:35)
107     at WebSocketConnection.onMessage (/home/ntang/lorebot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:288:17)
108     at WebSocket.onMessage (/home/ntang/lorebot/node_modules/ws/lib/EventTarget.js:103:16)
109     at emitTwo (events.js:106:13)
110 error: Forever detected script exited with code: 1
111 error: Script restart attempt #2
112 Lorebot ready!