diff --git a/config/config.json b/config/config.json index def7cc3..d52606c 100644 --- a/config/config.json +++ b/config/config.json @@ -1,12 +1,13 @@ { "debug": true, "core": true, + "maxFeed": 10, + "adapter": "lgr", "poke": true, "60s": true, "fanqie": true, "zwa": true, "rss": true, "help": true, - "welcome": true, - "maxFeed": 10 + "welcome": true } diff --git a/config/feeds.json b/config/feeds.json index 3eb5adb..fe51488 100644 --- a/config/feeds.json +++ b/config/feeds.json @@ -1,7 +1 @@ -[ - { - "url": "", - "targetGroups": [114,154], - "screenshot": true - } -] +[] diff --git a/lib/core/meme.js b/lib/core/meme.js new file mode 100644 index 0000000..375c27c --- /dev/null +++ b/lib/core/meme.js @@ -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; diff --git a/lib/yunzai/group.js b/lib/yunzai/group.js new file mode 100644 index 0000000..5a96950 --- /dev/null +++ b/lib/yunzai/group.js @@ -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(); diff --git a/lib/yunzai/message.js b/lib/yunzai/message.js new file mode 100644 index 0000000..798e1dd --- /dev/null +++ b/lib/yunzai/message.js @@ -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(); diff --git a/lib/yunzai/self.js b/lib/yunzai/self.js new file mode 100644 index 0000000..8cca86a --- /dev/null +++ b/lib/yunzai/self.js @@ -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();