mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-12-05 15:41:56 +00:00
feat:增加一些工具类
This commit is contained in:
parent
57ab9c611a
commit
9c496f4e06
@ -1,5 +1,6 @@
|
||||
{
|
||||
"debug": true,
|
||||
"core": true,
|
||||
"maxFeed": 10
|
||||
"maxFeed": 10,
|
||||
"adapter": "lgr"
|
||||
}
|
||||
|
||||
@ -1,7 +1 @@
|
||||
[
|
||||
{
|
||||
"url": "",
|
||||
"targetGroups": [114,154],
|
||||
"screenshot": true
|
||||
}
|
||||
]
|
||||
[]
|
||||
|
||||
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