installed \"league-connect\" via npm, I copy pasted this and got \"ws.subscribe is not a function\", the same goes with ws.on(...
Are you using TypeScript? I think there might be some issues with the typedefs exported so I'm going to look into that.
\nI ran this js snippet on Node 14.15.4 using league-connect 5.0.2 and it seems to work just fine for me.
\nconst {\n authenticate,\n connect\n} = require('league-connect')\n\nasync function main() {\n const credentials = await authenticate()\n console.log(credentials)\n\n const ws = await connect(credentials)\n\n ws.on('message', message => {\n console.log(message)\n })\n ws.subscribe('/lol-chat/v1/conversations/active', (data, event) => {\n console.log(data)\n })\n}\n\nmain()
-
installed "league-connect" via npm, I copy pasted this and got "ws.subscribe is not a function", the same goes with |
Beta Was this translation helpful? Give feedback.
-
Are you using TypeScript? I think there might be some issues with the typedefs exported so I'm going to look into that. I ran this js snippet on Node 14.15.4 using league-connect 5.0.2 and it seems to work just fine for me. const {
authenticate,
connect
} = require('league-connect')
async function main() {
const credentials = await authenticate()
console.log(credentials)
const ws = await connect(credentials)
ws.on('message', message => {
console.log(message)
})
ws.subscribe('/lol-chat/v1/conversations/active', (data, event) => {
console.log(data)
})
}
main() |
Beta Was this translation helpful? Give feedback.
-
I used JavaScript and this works for me too. Thanks for the quick reply! |
Beta Was this translation helpful? Give feedback.
Are you using TypeScript? I think there might be some issues with the typedefs exported so I'm going to look into that.
I ran this js snippet on Node 14.15.4 using league-connect 5.0.2 and it seems to work just fine for me.