1.签到系统错误修复2.商店系统修复bug并更新购买逻辑3.将炉灰加入商店并添加炉渣配方4.修改一些炼金系统的逻辑
This commit is contained in:
@@ -160,21 +160,21 @@ class WPSConfigAPI(WPSAPI):
|
||||
except (TypeError, ValueError):
|
||||
return 0
|
||||
|
||||
def get_user_name(self, chat_id: int, user_id: int) -> Optional[str]:
|
||||
def get_user_name(self, user_id: int) -> Optional[str]:
|
||||
record = self._get_user_record(user_id)
|
||||
if not record:
|
||||
return f"user_{user_id}"
|
||||
value = record.get("username")
|
||||
return str(value) if value else f"user_{user_id}"
|
||||
|
||||
def get_user_url(self, chat_id: int, user_id: int) -> Optional[str]:
|
||||
def get_user_url(self, user_id: int) -> Optional[str]:
|
||||
record = self._get_user_record(user_id)
|
||||
if not record:
|
||||
return None
|
||||
value = record.get("userurl")
|
||||
return str(value) if value else None
|
||||
|
||||
def get_user_points(self, chat_id: int, user_id: int) -> int:
|
||||
def get_user_points(self, user_id: int) -> int:
|
||||
record = self._get_user_record(user_id)
|
||||
if not record:
|
||||
return 0
|
||||
@@ -224,7 +224,15 @@ class WPSCheckinAPI(WPSAPI):
|
||||
|
||||
def _set_today_checkin_status(self, user_id: int) -> None:
|
||||
cursor = get_db().conn.cursor()
|
||||
cursor.execute("INSERT INTO daily_checkin (user_id, checkin_date) VALUES (?, ?)", (user_id, datetime.now().strftime("%Y-%m-%d")))
|
||||
cursor.execute(
|
||||
"""
|
||||
INSERT INTO daily_checkin (user_id, checkin_date)
|
||||
VALUES (?, ?)
|
||||
ON CONFLICT(user_id) DO UPDATE SET
|
||||
checkin_date = excluded.checkin_date
|
||||
""",
|
||||
(user_id, datetime.now().strftime("%Y-%m-%d")),
|
||||
)
|
||||
get_db().conn.commit()
|
||||
|
||||
async def do_callback(self, message: str, chat_id: int, user_id: int) -> Optional[str]:
|
||||
@@ -259,7 +267,7 @@ class WPSCheckinAPI(WPSAPI):
|
||||
return f'''# 📅 Daily 命令帮助
|
||||
- checkin: 签到
|
||||
---
|
||||
- 当前分数: {wps_config_api.get_user_points(chat_id, user_id)}
|
||||
- 当前分数: {wps_config_api.get_user_points(user_id)}
|
||||
- 今日签到状态: {"已签到" if self._get_today_checkin_status(user_id) else "未签到"}
|
||||
'''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user