修复非文本消息导致的报错

This commit is contained in:
San Liy 2023-12-21 00:07:00 +08:00
parent a3688bad16
commit 5edd7cd133

View File

@ -110,6 +110,8 @@ class SioDecorator:
self.cmds[f'/{cmd}'] = func self.cmds[f'/{cmd}'] = func
async def route2cmd_and_run(self): async def route2cmd_and_run(self):
if self._cmd == '':
return None
func = self.cmds.get(self._cmd[0]) func = self.cmds.get(self._cmd[0])
if func: if func:
sender_id = self.data['message']['senderId'] sender_id = self.data['message']['senderId']