Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
b8ba1c561a | |||
b184661da0 | |||
5bcc24933f | |||
5dbd3aa87a |
25
connect.py
25
connect.py
|
@ -277,14 +277,23 @@ async def add_message(data: Dict[str, Any]):
|
||||||
await asyncio.sleep(random.random() * 2)
|
await asyncio.sleep(random.random() * 2)
|
||||||
await sio.emit('sendMessage', message.to_json())
|
await sio.emit('sendMessage', message.to_json())
|
||||||
elif data['message']['content'] == '!!jrrp':
|
elif data['message']['content'] == '!!jrrp':
|
||||||
randomer = random.Random(f'{sender_id}-{data["message"]["date"]}-jrrp-v2')
|
examSet = False
|
||||||
result = randomer.randint(0, 50) + randomer.randint(0, 50)
|
if examSet == True:
|
||||||
print(f'{sender_name} 今日人品值为 {result}')
|
print('examSet参数被设定,替换人品值')
|
||||||
message = Message(content=f'{sender_name} 今日人品值为 {result}',
|
message = Message(content=f'{sender_name} 今日人品值为 100\n为了让你安心备考,加油考试,今天你的人品值是100!',
|
||||||
reply_to=reply,
|
reply_to=reply,
|
||||||
room_id=room_id)
|
room_id=room_id)
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.5)
|
||||||
await sio.emit('sendMessage', message.to_json())
|
await sio.emit('sendMessage', message.to_json())
|
||||||
|
else:
|
||||||
|
randomer = random.Random(f'{sender_id}-{data["message"]["date"]}-jrrp-v2')
|
||||||
|
result = randomer.randint(0, 50) + randomer.randint(0, 50)
|
||||||
|
print(f'{sender_name} 今日人品值为 {result}')
|
||||||
|
message = Message(content=f'{sender_name} 今日人品值为 {result}',
|
||||||
|
reply_to=reply,
|
||||||
|
room_id=room_id)
|
||||||
|
await asyncio.sleep(0.5)
|
||||||
|
await sio.emit('sendMessage', message.to_json())
|
||||||
# 如果只包括一个或多个 6
|
# 如果只包括一个或多个 6
|
||||||
# elif data['message']['content'].replace(' ', '') in ('6', '666', '六', '3+3', '5+1', '4+2', '2+4', '1+5'):
|
# elif data['message']['content'].replace(' ', '') in ('6', '666', '六', '3+3', '5+1', '4+2', '2+4', '1+5'):
|
||||||
# reply = ReplyMessage(id=data['message']['_id'])
|
# reply = ReplyMessage(id=data['message']['_id'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user