Skip to content

Subscribing does not exist #43

Answered by junlarsen
VC4427 asked this question in Q&A
Discussion options

You must be logged in to vote

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()

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by junlarsen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #41 on February 14, 2021 15:16.