fix: 兼容旧目录
This commit is contained in:
		
							parent
							
								
									1fa6984ce5
								
							
						
					
					
						commit
						9ff5288458
					
				|  | @ -28,9 +28,10 @@ export class setPubCk extends plugin { | |||
|       ] | ||||
|     }) | ||||
| 
 | ||||
|     this.file = "./plugins/genshin/config/mys.pubCk.yaml" | ||||
|   } | ||||
|    | ||||
|   file = "./plugins/genshin/config/mys.pubCk.yaml" | ||||
| 
 | ||||
|   /** 配置公共ck */ | ||||
|   async setPubCk () { | ||||
|     /** 设置上下文,后续接收到内容会执行doRep方法 */ | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
|  import { plugin } from 'yunzai/core' | ||||
| import { gsCfg} from 'yunzai/mys' | ||||
| import { plugin } from 'yunzai/core' | ||||
| import { gsCfg } from 'yunzai/mys' | ||||
| import lodash from 'lodash' | ||||
| import fs from 'node:fs' | ||||
| import fetch from 'node-fetch' | ||||
|  | @ -15,7 +15,28 @@ gsCfg.cpCfg('mys', 'set') | |||
|  * 作者:曉K 更新:🌌 | ||||
|  */ | ||||
| export class strategy extends plugin { | ||||
|   constructor () { | ||||
|   path = './temp/strategy' | ||||
|   url = 'https://bbs-api.mihoyo.com/post/wapi/getPostFullInCollection?&gids=2&order_type=2&collection_id=' | ||||
|   collection_id = [ | ||||
|     [], | ||||
|     // 来源:西风驿站
 | ||||
|     [2319292, 2319293, 2319295, 2319296, 2319299, 2319294, 2319298], | ||||
|     // 来源:原神观测枢
 | ||||
|     [813033], | ||||
|     // 来源:派蒙喵喵屋
 | ||||
|     [341284], | ||||
|     // 来源:OH是姜姜呀(需特殊处理)
 | ||||
|     [341523], | ||||
|     // 来源:曉K → 废物一个
 | ||||
|     [1582613], | ||||
|     // 来源:坤易
 | ||||
|     [22148], | ||||
|     // 来源:婧枫赛赛
 | ||||
|     [1812949] | ||||
|   ] | ||||
|   source = ['西风驿站', '原神观测枢', '派蒙喵喵屋', 'OH是姜姜呀', '曉K', '坤易', '婧枫赛赛'] | ||||
|   oss = '?x-oss-process=image//resize,s_1200/quality,q_90/auto-orient,0/interlace,1/format,jpg' | ||||
|   constructor() { | ||||
|     /** | ||||
|      *  | ||||
|       name: '米游社攻略', | ||||
|  | @ -38,37 +59,11 @@ export class strategy extends plugin { | |||
|         } | ||||
|       ] | ||||
|     }) | ||||
| 
 | ||||
|     this.set = gsCfg.getConfig('mys', 'set') | ||||
| 
 | ||||
|     this.path = './temp/strategy' | ||||
| 
 | ||||
|     this.url = 'https://bbs-api.mihoyo.com/post/wapi/getPostFullInCollection?&gids=2&order_type=2&collection_id=' | ||||
|     this.collection_id = [ | ||||
|       [], | ||||
|       // 来源:西风驿站
 | ||||
|       [2319292, 2319293, 2319295, 2319296, 2319299, 2319294, 2319298], | ||||
|       // 来源:原神观测枢
 | ||||
|       [813033], | ||||
|       // 来源:派蒙喵喵屋
 | ||||
|       [341284], | ||||
|       // 来源:OH是姜姜呀(需特殊处理)
 | ||||
|       [341523], | ||||
|       // 来源:曉K → 废物一个
 | ||||
|       [1582613], | ||||
|       // 来源:坤易
 | ||||
|       [22148], | ||||
|       // 来源:婧枫赛赛
 | ||||
|       [1812949] | ||||
|     ] | ||||
| 
 | ||||
|     this.source = ['西风驿站', '原神观测枢', '派蒙喵喵屋', 'OH是姜姜呀', '曉K', '坤易', '婧枫赛赛'] | ||||
| 
 | ||||
|     this.oss = '?x-oss-process=image//resize,s_1200/quality,q_90/auto-orient,0/interlace,1/format,jpg' | ||||
|   } | ||||
| 
 | ||||
|   /** 初始化创建配置文件 */ | ||||
|   async init () { | ||||
|   async init() { | ||||
|     if (!fs.existsSync(this.path)) { | ||||
|       fs.mkdirSync(this.path) | ||||
|     } | ||||
|  | @ -82,7 +77,7 @@ export class strategy extends plugin { | |||
|   } | ||||
| 
 | ||||
|   /** #心海攻略 */ | ||||
|   async strategy () { | ||||
|   async strategy() { | ||||
|     let match = /^#?(更新)?(\S+)攻略([1-7])?$/.exec(this.e.msg) | ||||
| 
 | ||||
|     // let isUpdate = !!this.e.msg.includes('更新')
 | ||||
|  | @ -127,17 +122,17 @@ export class strategy extends plugin { | |||
|   } | ||||
| 
 | ||||
|   /** #攻略帮助 */ | ||||
|   async strategy_help () { | ||||
|   async strategy_help() { | ||||
|     await this.e.reply('攻略帮助:\n#心海攻略[1234567]\n#更新早柚攻略[1234567]\n#设置默认攻略[1234567]\n示例: 心海攻略4\n\n攻略来源:\n1——西风驿站\n2——原神观测枢\n3——派蒙喵喵屋\n4——OH是姜姜呀\n5——曉K\n6——坤易\n7——婧枫赛赛(角色配队一图流)') | ||||
|   } | ||||
| 
 | ||||
|   /** #设置默认攻略1 */ | ||||
|   async strategy_setting () { | ||||
|   async strategy_setting() { | ||||
|     let match = /^#?设置默认攻略([1-7])?$/.exec(this.e.msg) | ||||
|     let set = './plugins/genshin/config/mys.set.yaml' | ||||
|     let config = fs.readFileSync(set, 'utf8') | ||||
|     let num = Number(match[1]) | ||||
|     if(isNaN(num)) { | ||||
|     if (isNaN(num)) { | ||||
|       await this.e.reply('默认攻略设置方式为: \n#设置默认攻略[1234567] \n 请增加数字1-7其中一个') | ||||
|       return | ||||
|     } | ||||
|  | @ -148,7 +143,7 @@ export class strategy extends plugin { | |||
|   } | ||||
| 
 | ||||
|   /** 下载攻略图 */ | ||||
|   async getImg (name, group) { | ||||
|   async getImg(name, group) { | ||||
|     let msyRes = [] | ||||
|     this.collection_id[group].forEach((id) => msyRes.push(this.getData(this.url + id))) | ||||
| 
 | ||||
|  | @ -208,7 +203,7 @@ export class strategy extends plugin { | |||
|   } | ||||
| 
 | ||||
|   /** 获取数据 */ | ||||
|   async getData (url) { | ||||
|   async getData(url) { | ||||
|     let response = await fetch(url, { method: 'get' }) | ||||
|     if (!response.ok) { | ||||
|       return false | ||||
|  |  | |||
|  | @ -2,9 +2,7 @@ import { plugin } from 'yunzai/core' | |||
| import { gsCfg} from 'yunzai/mys' | ||||
| import User from '../model/user.js' | ||||
| export class user extends plugin { | ||||
| 
 | ||||
|   User = null | ||||
| 
 | ||||
|   constructor(e) { | ||||
|     /** | ||||
|      *  | ||||
|  |  | |||
|  | @ -2,6 +2,8 @@ import { plugin } from 'yunzai/core' | |||
| import User from '../model/user.js' | ||||
| import { MysInfo } from 'yunzai/mys' | ||||
| export class userAdmin extends plugin { | ||||
|   User = null | ||||
|   button = null | ||||
|   constructor(e) { | ||||
|     /** | ||||
|       name: '用户管理', | ||||
|  |  | |||
							
								
								
									
										10
									
								
								deploy.sh
								
								
								
								
							
							
						
						
									
										10
									
								
								deploy.sh
								
								
								
								
							|  | @ -1,10 +0,0 @@ | |||
| #!/usr/bin/env sh | ||||
| 
 | ||||
| # 确保脚本抛出遇到的错误 | ||||
| set -e | ||||
| 
 | ||||
| git init | ||||
| git add -A | ||||
| git commit -m 'update: 修复引用' | ||||
| 
 | ||||
| git push -f git@github.com:yoimiya-kokomi/Miao-Yunzai.git master:genshin | ||||
|  | @ -2,6 +2,7 @@ import moment from 'moment' | |||
| import lodash from 'lodash' | ||||
| import base from './base.js'  | ||||
| import { MysInfo } from 'yunzai/mys' | ||||
| // tudo
 | ||||
| import { Character } from '#miao.models' | ||||
| 
 | ||||
| export default class Abyss extends base { | ||||
|  |  | |||
|  | @ -1,5 +1,9 @@ | |||
| import _ from 'lodash' | ||||
| import { ConfigController as cfg } from 'yunzai/config' | ||||
| 
 | ||||
| 
 | ||||
| // tudo
 | ||||
| 
 | ||||
| import { Common, Version } from '#miao' | ||||
| import { Character } from '#miao.models' | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,6 +2,11 @@ import base from './base.js' | |||
| import {  gsCfg } from 'yunzai/mys' | ||||
| import lodash from 'lodash' | ||||
| import moment from 'moment' | ||||
| 
 | ||||
| 
 | ||||
| // tudo
 | ||||
| 
 | ||||
| 
 | ||||
| import { Character, Weapon } from '#miao.models' | ||||
| 
 | ||||
| export default class GachaData extends base { | ||||
|  |  | |||
|  | @ -4,6 +4,9 @@ import lodash from "lodash" | |||
| import fs from "node:fs"  | ||||
| import { downFile, sleep} from 'yunzai/utils' | ||||
| import { gsCfg } from 'yunzai/mys' | ||||
| 
 | ||||
| // tudo
 | ||||
| 
 | ||||
| import { Character, Weapon } from "#miao.models" | ||||
| 
 | ||||
| export default class GachaLog extends base { | ||||
|  |  | |||
|  | @ -0,0 +1,2 @@ | |||
| import { GSCfg} from 'yunzai/mys' | ||||
| export default GSCfg | ||||
|  | @ -3,6 +3,10 @@ import lodash from 'lodash' | |||
| import base from './base.js' | ||||
| 
 | ||||
| import { MysInfo,   } from 'yunzai/mys' | ||||
| 
 | ||||
| 
 | ||||
| // tudo
 | ||||
| 
 | ||||
| import { Character } from '#miao.models' | ||||
| 
 | ||||
| export default class Note extends base { | ||||
|  |  | |||
|  | @ -3,6 +3,10 @@ import { gsCfg } from 'yunzai/mys' | |||
| import lodash from 'lodash' | ||||
| import moment from 'moment' | ||||
| import fs from 'node:fs' | ||||
| 
 | ||||
| 
 | ||||
| // tudo
 | ||||
| 
 | ||||
| import { Character } from '#miao.models' | ||||
| 
 | ||||
| let dsz = '待实装' | ||||
|  |  | |||
|  | @ -6,6 +6,10 @@ import { gsCfg, MysUser, NoteUser } from 'yunzai/mys' | |||
| import { promisify } from 'node:util' | ||||
| import YAML from 'yaml' | ||||
| import { UserGameDB, sequelize } from 'yunzai/db' | ||||
| 
 | ||||
| 
 | ||||
| // tudo
 | ||||
| 
 | ||||
| import { Data } from '#miao' | ||||
| import { Player } from '#miao.models' | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,6 +2,9 @@ import base from './base.js' | |||
| import { MysInfo } from 'yunzai/mys' | ||||
| import {gsCfg} from 'yunzai/mys' | ||||
| import lodash from 'lodash' | ||||
| 
 | ||||
| // tudo
 | ||||
| 
 | ||||
| import { Weapon, Character } from '#miao.models' | ||||
| 
 | ||||
| export default class WeaponModel extends base { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue