feature:打劫功能只支持18-21之间开放。
This commit is contained in:
@@ -432,6 +432,7 @@ class PointTradePlugin(MessagePluginInterface):
|
||||
"""处理打劫积分命令"""
|
||||
import random
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
content = str(message.get("content", "")).strip()
|
||||
sender = message.get("sender")
|
||||
@@ -444,6 +445,12 @@ class PointTradePlugin(MessagePluginInterface):
|
||||
wcf.send_text("❌打劫功能仅在群聊中可用!", sender, "")
|
||||
return True, "非群聊环境"
|
||||
|
||||
# 检查时间限制 - 只允许在18:00-21:00之间打劫
|
||||
current_hour = datetime.now().hour
|
||||
if current_hour < 18 or current_hour >= 21:
|
||||
wcf.send_text("❌打劫功能仅在晚上18:00-21:00之间开放!请在开放时间再来。", roomid, sender)
|
||||
return True, "时间限制"
|
||||
|
||||
# 检查是否在押
|
||||
prison_status = self.points_db.check_prison_status(sender, roomid)
|
||||
if prison_status:
|
||||
|
||||
Reference in New Issue
Block a user