Skip to content

Commit

Permalink
优化信息提示
Browse files Browse the repository at this point in the history
  • Loading branch information
chen310 committed Mar 4, 2022
1 parent def2f0e commit 12ffee5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion task/createSharedPlaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

def start(user, task={}):
music = user.music
name = random.choice(task['name'])
if len(task['name']) == 0:
name = '歌单'
else:
name = random.choice(task['name'])
create_resp = music.playlist_create(name, 0, 'SHARED')
if create_resp['code'] == 200:
if task['delete'] == True:
Expand Down
2 changes: 1 addition & 1 deletion task/musicianSignin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ def start(user, task={}):

resp = music.user_access()
if resp['code'] == 200:
user.taskInfo(task['taskName'], '登录成功')
user.taskInfo(task['taskName'], '签到成功')
else:
user.taskInfo(task['taskName'], user.errMsg(resp))
2 changes: 2 additions & 0 deletions task/sendPrivateMsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ def start(user, task={}):
user.taskInfo(task['taskName'], '发送成功')
else:
user.taskInfo(task['taskName'], user.errMsg(resp))
else:
user.taskInfo(task['taskName'], '请填写用户 ID')
5 changes: 4 additions & 1 deletion user.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,10 @@ def musician_task(self):
for mission in mission_list:
missionId = str(mission['missionId'])
if mission['status'] == 0 and missionId in tasks:
self.taskInfo(mission['description'], '未完成')
if tasks[missionId]['enable']:
self.taskInfo(mission['description'], '未完成')
else:
self.taskInfo(mission['description'], '未开启任务')
elif mission['status'] == 10:
self.taskInfo(mission['description'], '进行中' + '(' + str(
mission['progressRate']) + '/' + str(mission['targetCount']) + ')')
Expand Down

0 comments on commit 12ffee5

Please sign in to comment.