Commit 29b142ae authored by nanahira's avatar nanahira

bump version

parent 650a859a
import 'koishi-adapter-onebot'; import 'koishi-adapter-onebot';
import { App, Session } from 'koishi-core'; import { App, Session } from 'koishi';
import * as koishiPluginCommon from 'koishi-plugin-common'; import * as koishiPluginOnebot from '@koishijs/plugin-onebot';
import { Config } from 'koishi-plugin-common'; import * as koishiPluginVerifier from '@koishijs/plugin-verifier';
import * as targetPlugin from './plugin'; import * as targetPlugin from './plugin';
const app = new App({ const app = new App({
prefix: process.env.COMMAND_PREFIX || '.',
});
app.plugin(koishiPluginOnebot, {
bots: [ bots: [
{ {
type: 'onebot:ws', protocol: 'ws',
server: process.env.ONEBOT_HOST || 'ws://127.0.0.1:6700', endpoint: process.env.ONEBOT_HOST || 'ws://127.0.0.1:6700',
selfId: process.env.ONEBOT_ID, selfId: process.env.ONEBOT_ID,
token: process.env.ONEBOT_TOKEN, token: process.env.ONEBOT_TOKEN,
}, },
], ],
prefix: process.env.COMMAND_PREFIX || '.',
}); });
app.plugin(koishiPluginCommon, { app.plugin(koishiPluginVerifier, {
echo: false,
onFriendRequest: true, onFriendRequest: true,
onGroupRequest: (session: Session) => onGuildRequest: (session: Session) =>
session.userId && session.userId &&
process.env.ADMIN_ID && process.env.ADMIN_ID &&
process.env.ADMIN_ID.split(',').includes(session.userId.toString()), process.env.ADMIN_ID.split(',').includes(session.userId.toString()),
} as Config); });
app.plugin( app.plugin(
targetPlugin, targetPlugin,
process.env.APP_CONFIG ? JSON.parse(process.env.APP_CONFIG) : undefined, process.env.APP_CONFIG ? JSON.parse(process.env.APP_CONFIG) : undefined,
......
This diff is collapsed.
...@@ -26,13 +26,11 @@ ...@@ -26,13 +26,11 @@
"author": "Nanahira", "author": "Nanahira",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"koishi-adapter-onebot": "^3.1.0", "@koishijs/plugin-onebot": "^4.0.0-alpha.7",
"koishi-core": "^3.14.1", "@koishijs/plugin-verifier": "^1.0.0-alpha.1",
"koishi-plugin-common": "^4.3.4", "koishi": "^4.0.0-alpha.9"
"lodash": "^4.17.21"
}, },
"devDependencies": { "devDependencies": {
"@types/lodash": "^4.14.172",
"@types/node": "^16.7.10", "@types/node": "^16.7.10",
"@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0", "@typescript-eslint/parser": "^4.30.0",
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"declaration": true, "declaration": true,
"sourceMap": true "sourceMap": true,
"skipLibCheck": true
}, },
"compileOnSave": true, "compileOnSave": true,
"allowJs": true, "allowJs": true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment