上传文件至 /
This commit is contained in:
parent
a7c4686f66
commit
ec3962306e
24
connect.py
24
connect.py
|
@ -14,6 +14,7 @@ from mcstatus import JavaServer
|
||||||
|
|
||||||
# 功能包引用处
|
# 功能包引用处
|
||||||
from module import hitokoto
|
from module import hitokoto
|
||||||
|
|
||||||
# 功能包结束引用
|
# 功能包结束引用
|
||||||
|
|
||||||
def get_config() -> Tuple[str, str, int]:
|
def get_config() -> Tuple[str, str, int]:
|
||||||
|
@ -219,13 +220,24 @@ 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 {ctypet}':
|
elif content.startswith("!!hitokoto"):
|
||||||
hitokoto.hitokoto(ctypet)
|
|
||||||
result_code, result_data = hitokoto.hitokoto()
|
ctypet = content[len("!!hitokoto "):]
|
||||||
|
if content == "!!hitokoto":
|
||||||
|
result_code, result_data = hitokoto.hitokoto("没有")
|
||||||
|
else:
|
||||||
|
result_code, result_data = hitokoto.hitokoto(ctypet)
|
||||||
|
|
||||||
if result_code == 3:
|
if result_code == 3:
|
||||||
message= Message(content=f"输入参数无效,将随机选取一言句子类型",room_id=data['roomId'])
|
message = Message(content=f"参数不对哦!",room_id=data['roomId'])
|
||||||
if result_code == 0:
|
elif result_code == 2:
|
||||||
message = Message(f"Hitokoto: {result_data['hitokoto']}")
|
message = Message(content=f"发生了不可描述的错误X_X", room_id=data['roomId'])
|
||||||
|
elif result_code == 0:
|
||||||
|
message = Message(content=f"Hitokoto: {result_data['hitokoto']}", room_id=data['roomId'])
|
||||||
|
else:
|
||||||
|
message = Message(content=f"但你看到这条消息就代表有bug出炉", room_id=data['roomId'])
|
||||||
|
|
||||||
|
await sio.emit('sendMessage', message.to_json())
|
||||||
|
|
||||||
elif data.get('message').get('content').startswith('=='):
|
elif data.get('message').get('content').startswith('=='):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user