Commit 14f368ee authored by nanahira's avatar nanahira

finish

parent 8d64992f
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
/build
/dist
/output
/config.yaml
.idea
/plugin
/install-npm.sh
.git*
/output
/dest
/config.yaml
.idea
.dockerignore
Dockerfile
/src
.eslintrc.js
.prettierrc
webpack.config.js
tsconfig.json
/plugin
{
"singleQuote": true,
"trailingComma": "all"
}
\ No newline at end of file
This diff is collapsed.
import 'koishi-adapter-onebot';
import { App } from 'koishi';
import { Session } from 'koishi-core';
import * as koishiPluginCommon from 'koishi-plugin-common';
import { Config } from 'koishi-plugin-common';
import * as targetPlugin from './plugin';
const app = new App({
bots: [
{
type: 'onebot:ws',
server: process.env.ONEBOT_HOST || 'ws://127.0.0.1:6700',
selfId: process.env.ONEBOT_ID,
token: process.env.ONEBOT_TOKEN,
},
],
prefix: process.env.COMMAND_PREFIX || '.',
});
app.plugin(koishiPluginCommon, {
echo: true,
onFriendRequest: true,
onGroupRequest: (session: Session) =>
session.userId &&
process.env.ADMIN_ID &&
process.env.ADMIN_ID.split(',').includes(session.userId.toString()),
} as Config);
app.plugin(
targetPlugin,
process.env.APP_CONFIG ? JSON.parse(process.env.APP_CONFIG) : undefined,
);
app.start();
#!/bin/bash
npm install --save \
lodash
npm install --save-dev \
@types/node \
@types/lodash \
typescript \
'@typescript-eslint/eslint-plugin@^4.28.2' \
'@typescript-eslint/parser@^4.28.2 '\
'eslint@^7.30.0' \
'eslint-config-prettier@^8.3.0' \
'eslint-plugin-prettier@^3.4.0' \
prettier
This diff is collapsed.
{
"name": "koishi-wrapper",
"version": "1.0.0",
"description": "A simple wrapper for Koishi.js, mainly for Windows.",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"start": "node dist/index.js"
},
"repository": {
"type": "git",
"url": "git@git.mycard.moe:nanahira/koishi-wrapper.git"
},
"keywords": [
"cqhttp"
],
"author": "Nanahira",
"license": "MIT",
"dependencies": {
"koishi": "^3.14.1",
"koishi-adapter-onebot": "^3.1.0",
"koishi-core": "^3.14.1",
"koishi-plugin-common": "^4.3.4",
"lodash": "^4.17.21"
},
"devDependencies": {
"@types/lodash": "^4.14.172",
"@types/node": "^16.7.10",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1",
"pkg": "^5.3.1",
"prettier": "^2.3.2",
"typescript": "^4.4.2"
}
}
{
"compilerOptions": {
"outDir": "dist",
"module": "commonjs",
"target": "esnext",
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"sourceMap": true
},
"compileOnSave": true,
"allowJs": true,
"include": [
"*.ts",
"src/**/*.ts",
"test/**/*.ts"
]
}
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