修改变量名

This commit is contained in:
SharwOrange橙夜 2023-12-30 15:30:41 +08:00
parent 196d3d8549
commit 3e68e1b509
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()) await sio.emit('sendMessage', message.to_json())
elif content == f'!!hitokoto {stypet}': elif content == f'!!hitokoto {ctypet}':
hitokoto.hitokoto(stypet) hitokoto.hitokoto(ctypet)
result_code, result_data = hitokoto.hitokoto() result_code, result_data = hitokoto.hitokoto()
if result_code == 3: if result_code == 3:
message= Message(content=f"输入参数无效,将随机选取一言句子类型",room_id=data['roomId']) message= Message(content=f"输入参数无效,将随机选取一言句子类型",room_id=data['roomId'])

View File

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