Ask coding questions

← Back to all posts
How to use wavelink/lavalink on repl.it?
Kingk1ll3r

I want to use wavelink in my python program an i dont know how to use it, someone know how to use it on repl.it :)?

Voters
Kingk1ll3r
Comments
hotnewtop
SixBeeps

Looks like pip installing it installs it just fine, but I'm not able to test if it works 100% or not.

Kingk1ll3r

@SixBeeps
the problem is every time i want to host the bot i get some warnings and i dont know why

SixBeeps

@Kingk1ll3r Can you post the warnings so that I can take a look?

Kingk1ll3r

@SixBeeps

  • Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
    WEBSOCKET | Connection Failure:: Cannot connect to host 127.0.0.1:2333 ssl:default [Connect call failed ('127.0.0.1', 2333)]
    Traceback (most recent call last):
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiohttp/connector.py", line 936, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
    File "/usr/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
    raise exceptions[0]
    File "/usr/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
    File "/usr/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
    File "/usr/lib/python3.8/asyncio/selector_events.py", line 496, in sock_connect
    return await fut
    File "/usr/lib/python3.8/asyncio/selector_events.py", line 528, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
    ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 2333)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/wavelink/websocket.py", line 76, in connect
self._websocket = await self._node.session.ws_connect(uri, headers=self.headers, heartbeat=self._node.heartbeat)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiohttp/client.py", line 721, in _ws_connect
resp = await self.request(method, url,
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiohttp/client.py", line 480, in _request
conn = await self._connector.connect(
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiohttp/connector.py", line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiohttp/connector.py", line 858, in _create_connection
, proto = await self._create_direct_connection(
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection
raise last_exc
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiohttp/connector.py", line 980, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiohttp/connector.py", line 943, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 127.0.0.1:2333 ssl:default [Connect call failed ('127.0.0.1', 2333)]

extremsnek

@Kingk1ll3r
I am currently having this issue as well, and I believe it is because repl.it does not have the 0.0.0.0:8000 uris so it connect to the websocket. I know flask can do this but it seems this cannot. I am not that experienced so this is probably wrong. If you've found a solution please let me know