This commit is contained in:
BadHappy 2023-12-31 09:29:03 +08:00
parent ce78613394
commit 743183b76e
2 changed files with 3 additions and 2 deletions

View File

@ -215,7 +215,7 @@ async def add_message(data: Dict[str, Any]):
# else: # else:
# message = Message(content=f"此服务器空无一人",room_id=data['roomId']) # message = Message(content=f"此服务器空无一人",room_id=data['roomId'])
message = Message(content=f"此服务器有 {status.players.online} 个玩家在线",reply_to=reply,room_id=data['roomId']) message = Message(content=f"此服务器有 {status.players.online} 个玩家在线", reply_to=reply, room_id=data['roomId'])
await sio.emit('sendMessage', message.to_json()) await sio.emit('sendMessage', message.to_json())
@ -224,7 +224,7 @@ async def add_message(data: Dict[str, Any]):
server = JavaServer.lookup("192.168.1.6:25565") server = JavaServer.lookup("192.168.1.6:25565")
query = server.query() query = server.query()
players = query.players.names players = query.players.names
message = Message(content=f"此服务器当前在线玩家有 {players}",reply_to=reply,room_id=data['roomId']) message = Message(content=f"此服务器当前在线玩家有 {players}", reply_to=reply, room_id=data['roomId'])
await sio.emit('sendMessage', message.to_json()) await sio.emit('sendMessage', message.to_json())

View File

@ -1,6 +1,7 @@
import requests import requests
import random import random
def hitokoto(ctypet): def hitokoto(ctypet):
result_type = None result_type = None