Skip to content

websocket example not working #206

@koholintian

Description

@koholintian

why doesn't the websocket example work? I get this error: on_message() takes 2 positional arguments but 3 were given

import poloniex
import logging
from time import sleep

logging.basicConfig()
poloniex.logger.setLevel(logging.DEBUG)

def on_volume(data):
print(data)

sock = poloniex.PoloniexSocketed()

sock.startws(subscribe={'24hvolume': on_volume})

sleep(5)

sock.subscribe(chan='ticker', callback=print)
sleep(1)

sock.unsubscribe(1002)
sleep(4)

sock.stopws()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not behaving as it should in the code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions