Skip to content

Commit

Permalink
Merge pull request #209 from Giftia/dev
Browse files Browse the repository at this point in the history
v3.5.6-fix
  • Loading branch information
Giftia authored Jun 23, 2022
2 parents 8eab60e + c09a87c commit 9dee11c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
10 changes: 8 additions & 2 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ qqBot:
#qqBot小夜的管理员列表,管理员有权执行管理员指令,且第一位管理员将会处理用户邀请小夜加群的请求:
QQBOT_ADMIN_LIST: ["1005056803", "2418754147", "38263547"]

#qq入群欢迎语,[@新人] 出现的部分将会替换成 @新人:
QQ_GROUP_WELCOME_MESSAGE: "[@新人] 你好呀,我是本群RBQ担当小夜!小夜的说明书在这里 https://docs.giftia.moe/ 噢,请问主人是要先吃饭呢,还是先洗澡呢,还是先*我呢~"
#qq入群欢迎语,@新人 出现的部分将会替换成 @新人:
QQ_GROUP_WELCOME_MESSAGE: "@新人 你好呀,我是本群RBQ担当小夜!小夜的说明书在这里 https://docs.giftia.moe/ 噢,请问主人是要先吃饭呢,还是先洗澡呢,还是先*我呢~"

#戳一戳的文案:
QQ_GROUP_POKE_REPLY_MESSAGE: "请不要戳小小夜 >_<"

#戳坏了的文案:
QQ_GROUP_POKE_BOOM_REPLY_MESSAGE: "哎呀戳坏了,不理你了 ٩(๑`^`๑)۶"

#自动批准好友请求开关,如果不启用,陌生人将不能邀请小夜加群:
AUTO_APPROVE_QQ_FRIEND_REQUEST_SWITCH: true
Expand Down
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (_cn_reg.test(process.cwd())) {
/**
* 声明依赖与配置
*/
const versionNumber = "v3.5.6"; //版本号
const versionNumber = "v3.5.6-fix"; //版本号
const version = `ChatDACS ${versionNumber}`; //系统版本,会显示在web端标题栏
const utils = require("./plugins/system/utils.js"); //载入系统通用模块
const Constants = require("./config/constants.js"); //系统常量
Expand Down Expand Up @@ -138,6 +138,8 @@ var onlineUsers = 0, //预定义
QQBOT_QQ,
QQBOT_ADMIN_LIST,
QQ_GROUP_WELCOME_MESSAGE,
QQ_GROUP_POKE_REPLY_MESSAGE,
QQ_GROUP_POKE_BOOM_REPLY_MESSAGE,
BILIBILI_LIVE_ROOM_ID,
CHAT_SWITCH,
CONNECT_GO_CQHTTP_SWITCH,
Expand Down Expand Up @@ -547,7 +549,7 @@ function StartQQBot() {

//群欢迎
if (event.notice_type === "group_increase") {
const welcomeMessage = QQ_GROUP_WELCOME_MESSAGE.replace(/\[@\]/g, `[CQ:at,qq=${event.user_id}]`);
const welcomeMessage = QQ_GROUP_WELCOME_MESSAGE.replace(/@/g, `[CQ:at,qq=${event.user_id}]`);
request(
`http://${GO_CQHTTP_SERVICE_API_URL}/send_group_msg?group_id=${event.group_id
}&message=${encodeURI(welcomeMessage)}`,
Expand Down Expand Up @@ -696,10 +698,9 @@ function StartQQBot() {

if (c1c_count > 2) {
c1c_count = 0;
const final = "哎呀戳坏了,不理你了 ٩(๑`^`๑)۶";
request(
`http://${GO_CQHTTP_SERVICE_API_URL}/send_group_msg?group_id=${event.group_id
}&message=${encodeURI(final)}`,
}&message=${encodeURI(QQ_GROUP_POKE_BOOM_REPLY_MESSAGE)}`,
function (error, _response, _body) {
if (!error) {
request(
Expand All @@ -716,10 +717,9 @@ function StartQQBot() {
},
);
} else {
const final = "请不要戳小小夜 >_<";
request(
`http://${GO_CQHTTP_SERVICE_API_URL}/send_group_msg?group_id=${event.group_id
}&message=${encodeURI(final)}`);
}&message=${encodeURI(QQ_GROUP_POKE_REPLY_MESSAGE)}`);
}
return 0;
}
Expand Down Expand Up @@ -2093,6 +2093,8 @@ async function InitConfig() {
QQBOT_QQ = config.qqBot.QQBOT_QQ; //qqBot使用的qq帐号
QQBOT_ADMIN_LIST = config.qqBot.QQBOT_ADMIN_LIST; //小夜的管理员列表
QQ_GROUP_WELCOME_MESSAGE = config.qqBot.QQ_GROUP_WELCOME_MESSAGE; //qq入群欢迎语
QQ_GROUP_POKE_REPLY_MESSAGE = config.qqBot.QQ_GROUP_POKE_REPLY_MESSAGE; //戳一戳的文案
QQ_GROUP_POKE_BOOM_REPLY_MESSAGE = config.qqBot.QQ_GROUP_POKE_BOOM_REPLY_MESSAGE; //戳坏了的文案
AUTO_APPROVE_QQ_FRIEND_REQUEST_SWITCH = config.qqBot.AUTO_APPROVE_QQ_FRIEND_REQUEST_SWITCH; //自动批准好友请求开关
QQBOT_PRIVATE_CHAT_SWITCH = config.qqBot.QQBOT_PRIVATE_CHAT_SWITCH; //私聊开关
CHAT_JIEBA_LIMIT = config.qqBot.CHAT_JIEBA_LIMIT; //qqBot限制分词数量
Expand Down
13 changes: 6 additions & 7 deletions plugins/danceCube.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module.exports = {
插件名: "内测·舞立方信息查询插件",
指令: "^[/!]?(绑定|个人信息|战绩|机台状态|关注机台|我要出勤)(.*)",
版本: "0.3",
版本: "0.4",
作者: "Giftina",
描述: "非官方插件。舞立方信息查询,可以查询玩家信息以及机台状态。内测期间,功能、返回结果、玩家绑定信息会随机失效。数据来源以及素材版权归属 胜骅科技 https://www.arccer.com/ ,如有侵权请联系作者删除。",
使用示例: "个人信息",
Expand Down Expand Up @@ -65,7 +65,7 @@ module.exports = {
return { type: "text", content: errorNoData };
} else {
const location = await AnalysisLocation(playerData[userId].location);
console.log(`将绑定信息地址 ${playerData[userId].location} 解析为 ${location}`.info);
console.log(`将绑定信息地址 ${playerData[userId].location} 解析为 ${location.province + location.city}`.log);
if (!location) {
return { type: "text", content: "解析你的地区失败了,对不起呀,你还可以手动查询,指令如:机台状态 浙江省 杭州市" };
} else {
Expand Down Expand Up @@ -467,15 +467,14 @@ ${reply.join("\n")}
*/
async function AnalysisLocation(location) {
// 简陋的省份解析
let province = location.slice(0, 2);
let city = location.slice(2, 4);
let province = location.split("省")[0];
const city = location.split("省")[1];

if (!province || !city) {
return;
}

province += "省";
city += "市";
return { province, city };
}

Expand All @@ -496,7 +495,7 @@ async function FocusMachine(userId, machineTerminalID) {
const machine = response.data.find((machine) => {
return machine.MachineTerminalID === machineTerminalID;
});
return machine[0];
return machine;
})
.catch(function (error) {
console.log(`获取玩家资料失败: ${error}`.error);
Expand Down Expand Up @@ -542,7 +541,7 @@ async function GoGoGo(userId) {
const machine = machineList.find((machine) => {
return machine.MachineTerminalID === focusMachine.machineTerminalID;
});
return machine[0];
return machine;
})
.catch(function (error) {
console.log(`获取机台状态失败: ${error}`.error);
Expand Down
Binary file modified plugins/go-cqhttp/go-cqhttp
Binary file not shown.
Binary file modified plugins/go-cqhttp/go-cqhttp_windows_amd64.exe
Binary file not shown.

0 comments on commit 9dee11c

Please sign in to comment.