-
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.
Answered by
junlarsen
Feb 14, 2021
Replies: 2 comments
-
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.
0 replies
Answer selected by
junlarsen
-
I used JavaScript and this works for me too. Thanks for the quick reply! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.