Skip to content

Commit

Permalink
添加无结果回显
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed May 7, 2022
1 parent e1c93c4 commit 50a9436
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 54 deletions.
4 changes: 2 additions & 2 deletions OlivaDiceOdyssey/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"author" : "lunzhiPenxil",
"namespace" : "OlivaDiceOdyssey",
"message_mode" : "old_string",
"version" : "3.0.0",
"svn" : 1,
"version" : "3.0.1",
"svn" : 2,
"compatible_svn" : 95,
"priority" : 30030,
"support" : [
Expand Down
4 changes: 2 additions & 2 deletions OlivaDiceOdyssey/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
'''


OlivaDiceOdyssey_ver = '3.0.0'
OlivaDiceOdyssey_svn = 1
OlivaDiceOdyssey_ver = '3.0.1'
OlivaDiceOdyssey_svn = 2
OlivaDiceOdyssey_ver_short = '%s(%s)' % (str(OlivaDiceOdyssey_ver), str(OlivaDiceOdyssey_svn))
106 changes: 56 additions & 50 deletions OlivaDiceOdyssey/msgReply.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,37 +175,40 @@ def unity_reply(plugin_event, Proc):
tmp_count = 0
tmp_page_max = 1
tmp_page_now = 1
for mod_this in tmp_res['data']['list']:
tmp_count += 1
tmp_res_list.append(
'[%s] %s' % (
str(tmp_count),
mod_this['title']
if len(tmp_res['data']['list']) > 0:
for mod_this in tmp_res['data']['list']:
tmp_count += 1
tmp_res_list.append(
'[%s] %s' % (
str(tmp_count),
mod_this['title']
)
)
tmp_page_max = tmp_res['data']['totalPages']
tmp_page_now = tmp_page
dictTValue['tCnmodsResult'] = '%s\n---[第%s/%s页]---' % (
'\n'.join(tmp_res_list),
str(tmp_page_now),
str(tmp_page_max)
)
tmp_page_max = tmp_res['data']['totalPages']
tmp_page_now = tmp_page
dictTValue['tCnmodsResult'] = '%s\n---[第%s/%s页]---' % (
'\n'.join(tmp_res_list),
str(tmp_page_now),
str(tmp_page_max)
)
tmp_reply_str = dictStrCustom['strOdysseyCnmodsSearch'].format(**dictTValue)
OlivaDiceCore.userConfig.setUserConfigByKey(
userConfigKey = 'cnmodsTemp',
userConfigValue = tmp_res,
botHash = plugin_event.bot_info.hash,
userId = plugin_event.data.user_id,
userType = 'user',
platform = plugin_event.platform['platform']
)
OlivaDiceCore.userConfig.writeUserConfigByUserHash(
userHash = OlivaDiceCore.userConfig.getUserHash(
tmp_reply_str = dictStrCustom['strOdysseyCnmodsSearch'].format(**dictTValue)
OlivaDiceCore.userConfig.setUserConfigByKey(
userConfigKey = 'cnmodsTemp',
userConfigValue = tmp_res,
botHash = plugin_event.bot_info.hash,
userId = plugin_event.data.user_id,
userType = 'user',
platform = plugin_event.platform['platform']
)
)
OlivaDiceCore.userConfig.writeUserConfigByUserHash(
userHash = OlivaDiceCore.userConfig.getUserHash(
userId = plugin_event.data.user_id,
userType = 'user',
platform = plugin_event.platform['platform']
)
)
else:
tmp_reply_str = '未找到相关魔都模组搜索结果'
except:
pass
if tmp_reply_str != None:
Expand All @@ -225,37 +228,40 @@ def unity_reply(plugin_event, Proc):
tmp_count = 0
tmp_page_max = 1
tmp_page_now = 1
for mod_this in tmp_res['data']['list']:
tmp_count += 1
tmp_res_list.append(
'[%s] %s' % (
str(tmp_count),
mod_this['title']
if len(tmp_res['data']['list']) > 0:
for mod_this in tmp_res['data']['list']:
tmp_count += 1
tmp_res_list.append(
'[%s] %s' % (
str(tmp_count),
mod_this['title']
)
)
tmp_page_max = tmp_res['data']['totalPages']
tmp_page_now = tmp_page
dictTValue['tCnmodsResult'] = '%s\n---[第%s/%s页]---' % (
'\n'.join(tmp_res_list),
str(tmp_page_now),
str(tmp_page_max)
)
tmp_page_max = tmp_res['data']['totalPages']
tmp_page_now = tmp_page
dictTValue['tCnmodsResult'] = '%s\n---[第%s/%s页]---' % (
'\n'.join(tmp_res_list),
str(tmp_page_now),
str(tmp_page_max)
)
tmp_reply_str = dictStrCustom['strOdysseyCnmodsLuck'].format(**dictTValue)
OlivaDiceCore.userConfig.setUserConfigByKey(
userConfigKey = 'cnmodsTemp',
userConfigValue = tmp_res,
botHash = plugin_event.bot_info.hash,
userId = plugin_event.data.user_id,
userType = 'user',
platform = plugin_event.platform['platform']
)
OlivaDiceCore.userConfig.writeUserConfigByUserHash(
userHash = OlivaDiceCore.userConfig.getUserHash(
tmp_reply_str = dictStrCustom['strOdysseyCnmodsLuck'].format(**dictTValue)
OlivaDiceCore.userConfig.setUserConfigByKey(
userConfigKey = 'cnmodsTemp',
userConfigValue = tmp_res,
botHash = plugin_event.bot_info.hash,
userId = plugin_event.data.user_id,
userType = 'user',
platform = plugin_event.platform['platform']
)
)
OlivaDiceCore.userConfig.writeUserConfigByUserHash(
userHash = OlivaDiceCore.userConfig.getUserHash(
userId = plugin_event.data.user_id,
userType = 'user',
platform = plugin_event.platform['platform']
)
)
else:
tmp_reply_str = '未找到魔都模组推荐结果'
except:
pass
if tmp_reply_str != None:
Expand Down

0 comments on commit 50a9436

Please sign in to comment.