Pre Merge pull request !60 from touchscale/master

This commit is contained in:
touchscale 2023-06-25 19:40:04 +00:00 committed by Gitee
commit d49db4afe0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 35 additions and 0 deletions

33
.puppeteerrc.cjs Normal file
View File

@ -0,0 +1,33 @@
const os = require("os");
const { existsSync } = require("fs");
const arch = os.arch();
let skipDownload = false;
let executablePath;
//win32 存在 Edge 优先选择
if (process.platform == "win32") {
if (
existsSync("C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")
) {
skipDownload = true;
executablePath =
"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe";
}
} else if (process.platform == "linux") {
//如果arm64架构跳过下载
if (arch == "arm64" || arch == "aarch64") {
skipDownload = true;
}
//不管什么架构,如果存在配置则跳过下载,且配置路径
if (existsSync("/usr/bin/chromium")) {
skipDownload = true;
executablePath = "/usr/bin/chromium";
}
}
/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
skipDownload,
executablePath,
};

View File

@ -698,6 +698,7 @@ class PluginsLoader {
/** 判断黑白名单 */ /** 判断黑白名单 */
checkBlack (e) { checkBlack (e) {
let other = cfg.getOther() let other = cfg.getOther()
let notice = cfg.getNotice()
if (e.test) return true if (e.test) return true

View File

@ -49,6 +49,7 @@ class Command {
group_id: data.group_id || 826198224, group_id: data.group_id || 826198224,
group_name: data.group_name || '测试群', group_name: data.group_name || '测试群',
user_id: data.user_id, user_id: data.user_id,
user_avatar:`https://q1.qlogo.cn/g?b=qq&s=0&nk=${data.user_id}`,
anonymous: null, anonymous: null,
message: [{ type: 'text', text }], message: [{ type: 'text', text }],
raw_message: text, raw_message: text,