(msg: MessageEvent)
| 78 | } |
| 79 | |
| 80 | wsOnMessage(msg: MessageEvent) { |
| 81 | let decoded: WsEvent = JSON.parse(msg.data.toString()); |
| 82 | switch (decoded.t) { |
| 83 | case "AuthSuccess": |
| 84 | this.auth = true; |
| 85 | this.logToOutput("successfully authorized", "Client"); |
| 86 | |
| 87 | for (let g of this.subQueue) { |
| 88 | this.subscribeGuild(g); |
| 89 | } |
| 90 | this.subQueue = []; |
| 91 | |
| 92 | break; |
| 93 | case "ScriptLogMessage": |
| 94 | this.handleScriptLogMessage(decoded); |
| 95 | break; |
| 96 | case "SubscriptionsUpdated": |
| 97 | this.logToOutput("subscriptions updated successfully: " + decoded.d, "Client"); |
| 98 | this.activeSubs = decoded.d; |
| 99 | break; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | wsOnClose(ev: CloseEvent) { |
| 104 | this.logToOutput(`ws closed ${ev.reason}, reconnecting in 5 sec...`, "Client"); |
nothing calls this directly
no test coverage detected