Compare commits

...

2 Commits

2 changed files with 3 additions and 5 deletions

View File

@ -219,8 +219,8 @@ async def add_message(data: Dict[str, Any]):
await sio.emit('sendMessage', message.to_json())
elif content == f'!!hitokoto {stypet}':
hitokoto.hitokoto(stypet)
elif content == f'!!hitokoto {ctypet}':
hitokoto.hitokoto(ctypet)
result_code, result_data = hitokoto.hitokoto()
if result_code == 3:
message= Message(content=f"输入参数无效,将随机选取一言句子类型",room_id=data['roomId'])

View File

@ -33,6 +33,4 @@ def hitokoto(ctypet):
params_value={'c':ctype}
hitokoto = requests.get('https://v1.hitokoto.cn',params=params_value)
return 0,(hitokoto.json())
except Exception as e:
return 2, None
return 0,(hitokoto.json())