Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #65 from Arondight/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mark9804 authored Jan 4, 2022
2 parents d519e11 + 2deed37 commit 16b57ce
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 54 deletions.
3 changes: 0 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ function login() {
// 处理登录滑动验证码
bot.on("system.login.slider", () => process.stdin.once("data", (input) => bot.sliderLogin(input.toString())));

// 处理登录图片验证码
bot.on("system.login.captcha", () => process.stdin.once("data", (input) => bot.captchaLogin(input.toString())));

// 处理设备锁事件
bot.on("system.login.device", () => {
bot.logger.info("在浏览器中打开网址,手机扫码完成后按下回车键继续。");
Expand Down
14 changes: 7 additions & 7 deletions config_defaults/prophecy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ data:
summary:
lucky: "★☆☆☆☆☆☆"
text: 虽用心计,事难遂愿,贪功好进,必招失败
annotation: 无论在社会中有什么地位都会被认定为最低层的人。你深深体会到社会的不公平一面,为了替贫民谋幸福,你会想尽办法改善社会的状况,尤其是如何改善最低下层平民的生活
annotation: 虽然已经进行了谋划,但是事情的发展是由多方面因素决定的,高估了自己的力量,不该出手时出了手,失败是必然的
-
summary: 大吉+财运+官运
lucky: "★★★★★★☆"
Expand All @@ -295,7 +295,7 @@ data:
summary: 吉带凶
lucky: "★★☆☆☆☆☆"
text: 外观隆昌,内隐祸患,克服难关,开出泰运
annotation: 外人看来很风光,而自已内部隐藏的危机,只要解决内部的危机,人生将会过得风风火火。
annotation: 外人看来很风光,而自已内部隐藏着危机,如果解决内部的危机,人生将会过得风风火火。
-
summary: 中吉
lucky: "★★★★★☆☆"
Expand Down Expand Up @@ -330,12 +330,12 @@ data:
summary: 凶带吉
lucky: "★★☆☆☆☆☆"
text: 一成一败,一盛一衰,惟靠谨慎,可守成功
annotation: 成 败, 盛 衰这都是相对的,有成功就会有失败,有强盛就会有衰落这都只是时间问题,只有坚定的信念对能获得一定的成功但并不能够永久
annotation: 成败、盛衰都是相对的,有成功就会有失败,有强盛就会有衰落,这都只是时间问题,只有坚定信念方能守住成功
-
summary: 吉带凶
lucky: "★☆☆☆☆☆☆"
text: 一盛一衰,浮沉不常,自重自处,可保平安
annotation: 人生有盛有衰,十年河西,十年河东。不论在顺利的时候的还是在倒霉的时候,都要做到自重自处,不能因胜利而洋洋自得,也不能因失败而一蹶不振,只要这样,才能平平安安!
annotation: 人生有盛有衰,十年河西,十年河东。不论在顺利的时候的还是在倒霉的时候,都要做到自重自处,不能因胜利而洋洋自得,也不能因失败而一蹶不振,如此为人处事,可保自身平安。
-
summary: 吉带凶
lucky: "★★☆☆☆☆☆"
Expand All @@ -360,12 +360,12 @@ data:
summary:
lucky: "☆☆☆☆☆☆☆"
text: 鱼临旱地,难逃恶运,此数大凶,不如更名
annotation: 现时处境就如鱼在旱地上一样,面临大的恶运,是大凶之兆,此处的“不如更名”从现代角度来看,并非全指改名,而更多是指要改变现在的做人处事方式,才能摆脱大凶的来临。
annotation: 现时处境就如鱼在旱地上一样,面临大的恶运,是大凶之兆,要改变现在的做人处事方式,才能摆脱大凶的来临。
-
summary: 吉带凶
lucky: "★★☆☆☆☆☆"
text: 雨夜之花,外祥内苦,忍耐自重,转凶为吉
annotation: 下雨对于花来说,是件好事,但是雨夜,像征着孤独、恐惧、所以,看似吉祥的一片,实是内心承受着煎熬。如果坚强的忍耐过雨夜的敲打,熬过寂寞与恐惧,待明晨又是个艳阳天。
annotation: 下雨对于花来说,是件好事,但是雨夜又象征着孤独、恐惧,所以虽从外表上看一片祥和,实是内心承受着煎熬。如果坚强的忍耐过雨夜的敲打,熬过寂寞与恐惧,待明晨又是个艳阳天。
-
summary:
lucky: "★★☆☆☆☆☆"
Expand All @@ -385,7 +385,7 @@ data:
summary:
lucky: "☆☆☆☆☆☆☆"
text: 灾难不绝,难望成功,此数大凶,不如更名
annotation: 人生路上遇到相当多困难,特别在追求事业的路上,什么事情很难成功。此处的“不如更名”从现代角度来看,并非全指改名,而更多是指要改变现在的做人处事方式,方能扭转现在的运数。
annotation: 人生路上遇到相当多困难,特别在追求事业的路上,什么事情很难成功。要改变现在的做人处事方式,方能扭转现在的运数。
-
summary:
lucky: "★☆☆☆☆☆☆"
Expand Down
75 changes: 48 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"moment-timezone": "0.5.34",
"node-fetch": "3.1.0",
"node-schedule": "2.1.0",
"oicq": "2.1.8",
"oicq": "2.1.9",
"p-limit": "4.0.0",
"pm2": "5.1.2",
"pretty-bytes": "5.6.0",
Expand Down
Binary file added resources/Version2/info/image/龙嗣伪鳍.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/plugins/gacha/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function Plugin(msg) {
const name = getPool(msg);
const guess = guessPossibleNames(name, Object.values(global.command.functions.options.pool));
if ((undefined === name || guess.length > 0) && false !== checkAuth(msg, "pool")) {
doPool(msg, 1 == guess.length ? guess[0] : name);
doPool(msg, 1 === guess.length ? guess[0] : name);
}
break;
}
Expand All @@ -35,7 +35,7 @@ async function Plugin(msg) {
const name = getName(msg);
const guess = guessPossibleNames(name, global.names.weapon);
if (guess.length > 0 && false !== checkAuth(msg, "select")) {
doSelect(msg, 1 == guess.length ? guess[0] : name);
doSelect(msg, 1 === guess.length ? guess[0] : name);
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/master/reply_auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function setReplyAuth(msg) {
const curType = item.group_id ? "group" : "private";
const itemID = item.group_id ? item.group_id : item.user_id;

if (itemID == id) {
if (itemID === id) {
// 群通知不需要 @
msg.bot.say(id, `主人已${isOn ? "允许" : "禁止"}我响应消息。`, curType);
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/overview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function Plugin(msg) {
switch (true) {
case hasEntrance(msg.text, "overview", "info"):
if (guess.length > 0 && false !== checkAuth(msg, "info")) {
doInfo(msg, 1 == guess.length ? guess[0] : name, guess);
doInfo(msg, 1 === guess.length ? guess[0] : name, guess);
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/rating/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async function imageOrc(msg, url) {
msg.bot.say(msg.sid, `AI 识别出错。`, msg.type, msg.uid, true);
}

if (200 != response.status) {
if (200 !== response.status) {
msg.bot.say(msg.sid, `AI 识别出错。`, msg.type, msg.uid, true);
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tools/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function feedback(msg) {
const text = `我这就去给主人带个话!如果有重要的反馈和建议可以到这里留言哦:
https://github.com/Arondight/Adachi-BOT/issues`;
const textMaster =
(msg.sid == msg.uid ? "" : `${msg.group_name}${msg.sid})中的`) +
(msg.sid === msg.uid ? "" : `${msg.group_name}${msg.sid})中的`) +
`${msg.name}${msg.uid})给主人带个话:\n${info}`;

// 私聊无法 @
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tools_master/reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function reply(msg) {
const curType = item.group_id ? "group" : "private";
const itemID = "group" === curType ? item.group_id : item.user_id;

if (itemID == target) {
if (itemID === target) {
// 送话无法 @
msg.bot.say(itemID, `主人让我送个话:\n${text}`, curType);
// 私聊无法 @
Expand Down
2 changes: 1 addition & 1 deletion src/utils/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function checkAuth(msg, func, report = true) {
const uauth = hasAuth(msg.uid, func);
const gauth = hasAuth(msg.sid, func);

if (undefined == uauth && undefined === gauth) {
if (undefined === uauth && undefined === gauth) {
return undefined;
}

Expand Down
13 changes: 7 additions & 6 deletions src/utils/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function getEffectiveCookie(uid, s, use_cookie) {
return s >= cookies.length ? cookie : getEffectiveCookie(uid, s + 1, use_cookie);
}

if (date && date != today) {
if (date && date !== today) {
times = 0;
}

Expand Down Expand Up @@ -112,12 +112,13 @@ function writeInvalidCookie(cookie) {
if (!db.includes(dbName, "cookie", "cookie", cookie)) {
const initData = { cookie, cookie_token, account_id };
db.push(dbName, "cookie", initData);
markCookieUnusable(cookie);
}

markCookieUnusable(cookie);

// 删除该 Cookie 所有的使用记录
if (db.includes(dbCookieName, "uid", "cookie", cookie)) {
db.remove(dbCookieName, "uid", { cookie });
}
// 删除该 Cookie 所有的使用记录
if (db.includes(dbCookieName, "uid", "cookie", cookie)) {
db.remove(dbCookieName, "uid", { cookie });
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/utils/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ function cleanByTimeDB(dbName, dbKey = ["user", "uid"], timeRecord = "uid", mill
// 没有基准字段则删除该记录(因为很可能是错误数据)
if (!uid || !has(dbName, dbKey[0], i, dbKey[1])) {
records.splice(i, 1);
--i;
--len;
++nums;
continue;
Expand All @@ -152,6 +153,7 @@ function cleanByTimeDB(dbName, dbKey = ["user", "uid"], timeRecord = "uid", mill

if (!time || now - time > milliseconds) {
records.splice(i, 1);
--i;
--len;
++nums;
}
Expand All @@ -177,8 +179,9 @@ function cleanCookies() {
for (let i = 0, len = records.length; i < len; ++i) {
// 1. 没有基准字段则删除该记录
// 2. 不是今天的记录一律删除
if (!records[i].date || today != records[i].date) {
if (!records[i].date || today !== records[i].date) {
records.splice(i, 1);
--i;
--len;
++nums;
}
Expand All @@ -201,6 +204,7 @@ function cleanCookiesInvalid() {
for (let i = 0, len = records.length; i < len; ++i) {
if (!records[i].cookie || !global.cookies.includes(records[i].cookie)) {
records.splice(i, 1);
--i;
--len;
++nums;
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/genshin-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<img class="background" :src="infoBackground" alt="ERROR" />
<img :class="'角色' === type ? 'character' : 'weapon'" :src="mainImage" alt="ERROR" />
<div class="content">
<p class="title-and-name" v-if="name == '旅行者'">「旅行者」</p>
<p class="title-and-name" v-if="name === '旅行者'">「旅行者」</p>
<p class="title-and-name" v-else>「{{ title }}·{{ name }}」</p>
</div>
<div class="introduction">
Expand Down

0 comments on commit 16b57ce

Please sign in to comment.