Merge remote-tracking branch 'origin/main'

# Conflicts:
#	config/config.json
#	lib/config/configControl.js
This commit is contained in:
Jerry 2025-10-04 13:56:29 +08:00
commit 4cd4d3e538
6 changed files with 66 additions and 9 deletions

View File

@ -1,12 +1,13 @@
{ {
"debug": true, "debug": true,
"core": true, "core": true,
"maxFeed": 10,
"adapter": "lgr",
"poke": true, "poke": true,
"60s": true, "60s": true,
"fanqie": true, "fanqie": true,
"zwa": true, "zwa": true,
"rss": true, "rss": true,
"help": true, "help": true,
"welcome": true, "welcome": true
"maxFeed": 10
} }

View File

@ -1,7 +1 @@
[ []
{
"url": "",
"targetGroups": [114,154],
"screenshot": true
}
]

14
lib/core/meme.js Normal file
View File

@ -0,0 +1,14 @@
import ConfigControl from '../config/configControl.js';
import axios from 'axios';
const Meme = {
async getMeme(character, status) {
const coreConfig = await ConfigControl.get()?.coreConfig;
const coreUrl = coreConfig?.coreUrl;
const token = coreConfig?.token;
//logger.info(`${coreUrl}/api/meme`);
return `${coreUrl}/api/meme?token=${token}?character=${character}&status=${status}`;
},
};
export default Meme;

16
lib/yunzai/group.js Normal file
View File

@ -0,0 +1,16 @@
import ConfigControl from '../config/configControl.js';
class NapcatGroup {}
class LgrGroup {}
async function getGroupAdapter() {
const adapter = (await ConfigControl.get('config'))?.adapter;
if (!adapter || adapter === 'nc' || adapter === 'napcat') {
return new NapcatGroup();
} else if (adapter === 'lgr' || adapter === 'lagrange') {
return new LgrGroup();
}
return new NapcatGroup();
}
export default await getGroupAdapter();

16
lib/yunzai/message.js Normal file
View File

@ -0,0 +1,16 @@
import ConfigControl from '../config/configControl.js';
class NapcatMessage {}
class LgrMessage {}
async function getMessageAdapter() {
const adapter = (await ConfigControl.get('config'))?.adapter;
if (!adapter || adapter === 'nc' || adapter === 'napcat') {
return new NapcatMessage();
} else if (adapter === 'lgr' || adapter === 'lagrange') {
return new LgrMessage();
}
return new NapcatMessage();
}
export default await getMessageAdapter();

16
lib/yunzai/self.js Normal file
View File

@ -0,0 +1,16 @@
import ConfigControl from '../config/configControl.js';
class NapcatSelf {}
class LgrSelf {}
async function getSelfAdapter() {
const adapter = (await ConfigControl.get('config'))?.adapter;
if (!adapter || adapter === 'nc' || adapter === 'napcat') {
return new NapcatSelf();
} else if (adapter === 'lgr' || adapter === 'lagrange') {
return new LgrSelf();
}
return new NapcatSelf();
}
export default await getSelfAdapter();