mirror of
https://github.com/Le-niao/Yunzai-Bot.git
synced 2025-01-07 08:36:39 +08:00
修复bug,增加提示
This commit is contained in:
parent
0a112c0745
commit
692467e0df
@ -3,7 +3,7 @@ module.exports = {
|
||||
es2021: true,
|
||||
node: true
|
||||
},
|
||||
extends: ['standard', 'prettier'],
|
||||
extends: ['standard'],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module'
|
||||
@ -14,13 +14,9 @@ module.exports = {
|
||||
logger: true,
|
||||
plugin: true
|
||||
},
|
||||
plugins: ['prettier'],
|
||||
rules: {
|
||||
eqeqeq: ['off'],
|
||||
'prefer-const': ['off'],
|
||||
'prettier/prettier': 'error',
|
||||
'arrow-body-style': 'off',
|
||||
'prefer-arrow-callback': 'off',
|
||||
'space-before-function-paren': 'off'
|
||||
'arrow-body-style': 'off'
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
/dist/*
|
||||
.local
|
||||
.output.js
|
||||
/node_modules/**
|
||||
|
||||
**/*.svg
|
||||
**/*.sh
|
||||
|
||||
/public/*
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"tabWidth": 2,
|
||||
"semi": false,
|
||||
"spaceBeforeFunctionParen": true,
|
||||
"bracketSameLine": true
|
||||
}
|
14
README.md
14
README.md
@ -6,7 +6,7 @@
|
||||
[目前功能](https://github.com/Le-niao/Yunzai-Bot/tree/main/plugins/genshin)
|
||||
|
||||
## 使用方法
|
||||
>环境准备: Windows or Linux,Node.js([版本至少v16以上](http://nodejs.cn/download/)),[Redis](resources/readme/命令说明.md#window安装redis)
|
||||
>环境准备: Windows or Linux,Node.js([版本至少v16以上](http://nodejs.cn/download/)),[Redis](https://redis.io/docs/getting-started/installation/)
|
||||
|
||||
1.克隆项目
|
||||
```
|
||||
@ -27,3 +27,15 @@ pnpm install -P
|
||||
```
|
||||
node app
|
||||
```
|
||||
|
||||
## 致谢
|
||||
| Nickname | Contribution |
|
||||
| :----------------------------------------------------------: | ----------------------------------- |
|
||||
|[GardenHamster](https://github.com/GardenHamster/GenshinPray) | 模拟抽卡背景素材来源 |
|
||||
|[西风驿站](https://bbs.mihoyo.com/ys/collection/839181) | 角色攻略图来源 |
|
||||
|[米游社友人A](https://bbs.mihoyo.com/ys/collection/428421) | 角色突破素材图来源 |
|
||||
|
||||
## 其他
|
||||
- 最后给个star或者[爱发电](https://afdian.net/@Le-niao),你的支持是维护本项目的动力~~
|
||||
- 图片素材来源于网络,仅供交流学习使用
|
||||
- 严禁用于任何商业用途和非法行为
|
||||
|
@ -13,7 +13,10 @@ default:
|
||||
addPrivate: 1 #是否允许私聊添加 1-允许 0-禁止
|
||||
|
||||
enable: #只启用功能,配置后只有该功能才响应
|
||||
disable: #禁用功能,功能名称,例如:十连、角色查询、体力查询、用户绑定、抽卡记录、添加表情、欢迎新人
|
||||
|
||||
#禁用功能,功能名称,例如:十连、角色查询、体力查询、用户绑定、抽卡记录、添加表情、欢迎新人、退群通知
|
||||
#禁用功能,功能名称,例如:云崽帮助、角色素材、今日素材、养成计算、米游社公告
|
||||
disable:
|
||||
- 禁用示例
|
||||
- 支持多个
|
||||
|
||||
|
@ -93,7 +93,7 @@ async function makeForwardMsg (e, msg = [], dec = '') {
|
||||
|
||||
if (dec) {
|
||||
/** 处理描述 */
|
||||
forwardMsg = forwardMsg
|
||||
forwardMsg.data = forwardMsg.data
|
||||
.replace(/\n/g, '')
|
||||
.replace(/<title color="#777777" size="26">(.+?)<\/title>/g, '___')
|
||||
.replace(/___+/, `<title color="#777777" size="26">${dec}</title>`)
|
||||
|
@ -9,7 +9,6 @@
|
||||
"test": "node ./lib/tools/test.js",
|
||||
"login": "node app.js login",
|
||||
"dev": "node app.js dev",
|
||||
"format": "prettier --write \"**/*.{js,json,md}\"",
|
||||
"start": "pm2 start ./config/pm2/pm2.json",
|
||||
"stop": "pm2 stop ./config/pm2/pm2.json",
|
||||
"restart": "pm2 restart ./config/pm2/pm2.json",
|
||||
@ -38,10 +37,8 @@
|
||||
"eslint-config-standard": "^17.0.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-n": "^15.2.3",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"eslint-plugin-promise": "^6.0.0",
|
||||
"express": "^4.18.1",
|
||||
"express-art-template": "^1.0.1",
|
||||
"prettier": "^2.3.2"
|
||||
"express-art-template": "^1.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import gsCfg from '../model/gsCfg.js'
|
||||
export class calculator extends plugin {
|
||||
constructor () {
|
||||
super({
|
||||
name: '刻晴养成',
|
||||
name: '养成计算',
|
||||
dsc: '角色养成材料计算器',
|
||||
event: 'message',
|
||||
priority: 700,
|
||||
|
@ -177,7 +177,7 @@ export default class MysApi {
|
||||
'x-rpc-app_version': '2.34.1',
|
||||
'x-rpc-client_type': 5,
|
||||
'x-rpc-device_id': this.option.device_id || this.getGuid(),
|
||||
'User-Agent': ' miHoYoBBS/2.34.1',
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 11; Unspecified Device) Chrome/104.0.5112.81 Mobile Safari/537.36 Edg/104.0.1293.54 miHoYoBBS/2.34.1',
|
||||
'X-Requested-With': 'com.mihoyo.hyperion',
|
||||
'x-rpc-platform': 'android',
|
||||
Referer: 'https://webstatic.mihoyo.com/bbs/event/signin-ys/index.html?bbs_auth_required=true&act_id=e202009291139501&utm_source=bbs&utm_medium=mys&utm_campaign=icon',
|
||||
@ -185,9 +185,9 @@ export default class MysApi {
|
||||
}
|
||||
}
|
||||
return {
|
||||
'x-rpc-app_version': '2.33.1',
|
||||
'x-rpc-app_version': '2.34.1',
|
||||
'x-rpc-client_type': 5,
|
||||
'User-Agent': 'miHoYoBBS/2.33.1',
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; Unspecified Device) Chrome/104.0.5112.81 Mobile Safari/537.36 Edg/104.0.1293.54 miHoYoBBS/2.34.1',
|
||||
DS: this.getDs(query, body)
|
||||
}
|
||||
}
|
||||
@ -206,7 +206,6 @@ export default class MysApi {
|
||||
/** 签到ds */
|
||||
getDsSign () {
|
||||
/** @Womsxd */
|
||||
// const n = 'ulInCDohgEs557j0VsPDYnQaaz6KJcv5' //2.28.1
|
||||
const n = '9nQiU3AV0rJSIBWgdynfoGMGKaklfbM7'
|
||||
const t = Math.round(new Date().getTime() / 1000)
|
||||
const r = lodash.sampleSize('abcdefghijklmnopqrstuvwxyz0123456789', 6).join('')
|
||||
|
@ -74,6 +74,11 @@ export default class MysInfo {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!['1', '2', '5'].includes(String(mysInfo.uid)[0])) {
|
||||
// e.reply('只支持查询国服uid')
|
||||
return false
|
||||
}
|
||||
|
||||
mysInfo.e.uid = mysInfo.uid
|
||||
|
||||
/** 获取ck */
|
||||
|
@ -214,7 +214,7 @@ export default class MysSign extends base {
|
||||
let tips = ['开始原神签到任务']
|
||||
|
||||
let { noSignNum } = await this.getsignNum(uids)
|
||||
let time = noSignNum * 6 + noSignNum * 0.2 + uids.length * 0.02 + 5
|
||||
let time = noSignNum * 7.5 + noSignNum * 0.2 + uids.length * 0.02 + 5
|
||||
let finishTime = moment().add(time, 's').format('MM-DD HH:mm:ss')
|
||||
|
||||
tips.push(`\n签到ck:${uids.length}个`)
|
||||
@ -255,7 +255,7 @@ export default class MysSign extends base {
|
||||
failNum++
|
||||
}
|
||||
if (this.signApi) {
|
||||
await common.sleep(lodash.random(4, 8) * 1000)
|
||||
await common.sleep(lodash.random(5, 8) * 1000)
|
||||
this.signApi = false
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ export default class RoleDetail extends base {
|
||||
}
|
||||
|
||||
static async get (e) {
|
||||
if (e.msg.includes('角色详情')) return false
|
||||
let roleDetail = new RoleDetail(e)
|
||||
return await roleDetail.getDetail()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user