mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 06:12:53 +08:00
fix poke
This commit is contained in:
parent
724541d691
commit
7ab185f7d7
@ -248,6 +248,7 @@ __Docker 最新版本由 [Sakuracio](https://github.com/Sakuracio) 提供__
|
||||
* 修复私聊无法添加昵称
|
||||
* 修复原神玩家查询层岩巨渊地下矿区没开时报错
|
||||
* 修复 ```休息吧``` 无法阻断戳一戳
|
||||
* 当图库无图片时,戳一戳将略过发送图片
|
||||
|
||||
### 2022/5/26
|
||||
|
||||
|
||||
@ -62,12 +62,12 @@ async def _poke_event(event: PokeNotifyEvent):
|
||||
rst = "气死我了!"
|
||||
await poke_.finish(rst + random.choice(poke__reply), at_sender=True)
|
||||
rand = random.random()
|
||||
if rand <= 0.3:
|
||||
path = random.choice(["luoli", "meitu"])
|
||||
path = random.choice(["luoli", "meitu"])
|
||||
if rand <= 0.3 and len(os.listdir(IMAGE_PATH / "image_management" / path)) > 0:
|
||||
index = random.randint(0, len(os.listdir(IMAGE_PATH / "image_management" / path)))
|
||||
result = f"id:{index}" + image(f"{index}.jpg", "image_management/" + path)
|
||||
await poke_.send(result)
|
||||
logger.info(f"USER {event.user_id} 戳了戳我 回复: {result} \n {result}")
|
||||
logger.info(f"USER {event.user_id} 戳了戳我 回复: {result} {result}")
|
||||
elif 0.3 < rand < 0.6:
|
||||
voice = random.choice(os.listdir(RECORD_PATH / "dinggong"))
|
||||
result = record(voice, "dinggong")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user