mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-12-05 15:41:56 +00:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # config/config.json # lib/config/configControl.js
This commit is contained in:
commit
4cd4d3e538
@ -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
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1 @@
|
|||||||
[
|
[]
|
||||||
{
|
|
||||||
"url": "",
|
|
||||||
"targetGroups": [114,154],
|
|
||||||
"screenshot": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|||||||
14
lib/core/meme.js
Normal file
14
lib/core/meme.js
Normal 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
16
lib/yunzai/group.js
Normal 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
16
lib/yunzai/message.js
Normal 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
16
lib/yunzai/self.js
Normal 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();
|
||||||
Loading…
x
Reference in New Issue
Block a user