Updated arg system & made websocked somehow work???
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import websockets
|
||||
from macros import py_print
|
||||
import bot as botPy
|
||||
|
||||
ws_global = None
|
||||
|
||||
@@ -9,11 +10,11 @@ async def send_message(message: str):
|
||||
await ws_global.send(message)
|
||||
|
||||
|
||||
async def websocket_client():
|
||||
async def websocket_client(bot: botPy.Bot):
|
||||
global ws_global
|
||||
async with websockets.connect("ws://127.0.0.1:9001") as ws:
|
||||
async with websockets.connect(f"ws://127.0.0.1:{bot.args["port"]}") as ws:
|
||||
ws_global = ws
|
||||
py_print("Connected webSocket server on ws://127.0.0.1:9001")
|
||||
py_print(f"Connected webSocket server on ws://127.0.0.1:{bot.args["port"]}")
|
||||
|
||||
while True:
|
||||
response = await ws.recv()
|
||||
|
||||
Reference in New Issue
Block a user