add asengine client id
This commit is contained in:
@@ -154,7 +154,7 @@ class ASEngineClient:
|
|||||||
self.sid = None
|
self.sid = None
|
||||||
print("Disconnected from server")
|
print("Disconnected from server")
|
||||||
|
|
||||||
def send_text(self, route: str, text: str, id:str) -> bool:
|
def send_text(self, route: str, text: str, id:str="") -> bool:
|
||||||
"""
|
"""
|
||||||
发送文本消息
|
发送文本消息
|
||||||
:param route: 目标路由
|
:param route: 目标路由
|
||||||
@@ -164,7 +164,8 @@ class ASEngineClient:
|
|||||||
if not self.connected:
|
if not self.connected:
|
||||||
print("Not connected to server")
|
print("Not connected to server")
|
||||||
return False
|
return False
|
||||||
|
if id == "":
|
||||||
|
id = self.id
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.sio.emit(route, {'type': 'text', 'data': text, 'id': id}, namespace=self.namespace)
|
self.sio.emit(route, {'type': 'text', 'data': text, 'id': id}, namespace=self.namespace)
|
||||||
|
|||||||
Reference in New Issue
Block a user