add:星琼预估
This commit is contained in:
		
							parent
							
								
									a5cb607c98
								
							
						
					
					
						commit
						4bb8efabe4
					
				| 
						 | 
					@ -27,8 +27,8 @@ export class mysNews extends plugin {
 | 
				
			||||||
          fnc: 'mysUrl'
 | 
					          fnc: 'mysUrl'
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          reg: '^#*原(石|神)(预估|盘点)$',
 | 
					          reg: '^#*原(石|神)|星(琼|铁)(预估|盘点)$',
 | 
				
			||||||
          fnc: 'ysEstimate'
 | 
					          fnc: 'mysEstimate'
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          reg: '^#*(星铁|原神|崩坏三|崩三|绝区零|崩坏二|崩二|崩坏学园二|未定|未定事件簿)?(开启|关闭)(公告|资讯)推送$',
 | 
					          reg: '^#*(星铁|原神|崩坏三|崩三|绝区零|崩坏二|崩二|崩坏学园二|未定|未定事件簿)?(开启|关闭)(公告|资讯)推送$',
 | 
				
			||||||
| 
						 | 
					@ -84,8 +84,11 @@ export class mysNews extends plugin {
 | 
				
			||||||
    await this.reply(data)
 | 
					    await this.reply(data)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async ysEstimate() {
 | 
					  async mysEstimate() {
 | 
				
			||||||
    let data = await new MysNews(this.e).ysEstimate()
 | 
					    let args = ['版本原石', 218945821]
 | 
				
			||||||
 | 
					    if (/星(琼|铁)/.test(this.e.msg))
 | 
				
			||||||
 | 
					      args = ['可获取星琼', 73779489]
 | 
				
			||||||
 | 
					    let data = await new MysNews(this.e).mysEstimate(...args)
 | 
				
			||||||
    if (!data) return
 | 
					    if (!data) return
 | 
				
			||||||
    await this.reply(data)
 | 
					    await this.reply(data)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -93,6 +93,9 @@ export default class MysNews extends base {
 | 
				
			||||||
      case 'searchPosts':
 | 
					      case 'searchPosts':
 | 
				
			||||||
        host = 'https://bbs-api.miyoushe.com/post/wapi/searchPosts?'
 | 
					        host = 'https://bbs-api.miyoushe.com/post/wapi/searchPosts?'
 | 
				
			||||||
        break
 | 
					        break
 | 
				
			||||||
 | 
					      case 'userInstantSearchPosts':
 | 
				
			||||||
 | 
					        host = 'https://bbs-api.miyoushe.com/painter/api/user_instant/search/list?'
 | 
				
			||||||
 | 
					        break
 | 
				
			||||||
      // 帖子详情
 | 
					      // 帖子详情
 | 
				
			||||||
      case 'getPostFull':
 | 
					      case 'getPostFull':
 | 
				
			||||||
        host += 'post/wapi/getPostFull?'
 | 
					        host += 'post/wapi/getPostFull?'
 | 
				
			||||||
| 
						 | 
					@ -243,21 +246,14 @@ export default class MysNews extends base {
 | 
				
			||||||
    return this.replyMsg(img, `${param.data.post.subject}`)
 | 
					    return this.replyMsg(img, `${param.data.post.subject}`)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async ysEstimate() {
 | 
					  async mysEstimate(keyword, uid) {
 | 
				
			||||||
    let msg = '版本原石盘点'
 | 
					    let res = await this.postData('userInstantSearchPosts', { keyword, uid, size: 20, offset: 0, sort_type: 2 })
 | 
				
			||||||
    let res = await this.postData('searchPosts', { gids: 2, size: 20, keyword: msg })
 | 
					    let postList = res?.data?.list
 | 
				
			||||||
    if (res?.data?.posts.length <= 0) {
 | 
					    if (postList.length <= 0) {
 | 
				
			||||||
      await this.e.reply('暂无数据')
 | 
					      await this.e.reply('暂无数据')
 | 
				
			||||||
      return false
 | 
					      return false
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    let postId = ''
 | 
					    let postId = postList[0].post.post.post_id
 | 
				
			||||||
    for (let post of res.data.posts) {
 | 
					 | 
				
			||||||
      if (post.user.uid == '218945821') {
 | 
					 | 
				
			||||||
        postId = post.post.post_id
 | 
					 | 
				
			||||||
        break
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!postId) {
 | 
					    if (!postId) {
 | 
				
			||||||
      await this.e.reply('暂无数据')
 | 
					      await this.e.reply('暂无数据')
 | 
				
			||||||
      return false
 | 
					      return false
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue