2.4.0-patch3 • Published 4 years ago

@miraipie/http-adapter v2.4.0-patch3

Weekly downloads
-
License
AGPL-3.0
Repository
-
Last release
4 years ago

@miraipie/http-adapter

Http Adapter of miraipie.

安装

npm i @miraipie/http-adapter --save
# OR
yarn add @miraipie/http-adapter

使用

import { HttpAdapter } from '@miraipie/http-adapter';
// Node.js user
// const { HttpAdapter } = require('@miraipie/http-adapter');

const adapter = new HttpAdapter({
  qq: 123456789,                  // QQ
  verifyKey: 'verifyKey',         // mirai-api-http verifyKey
  url: 'http://127.0.0.1:3000',   // mirai-api-http serve url
  interval: 500,                  // polling interval(optional)
});

adapter.on('message', console.log);
adapter.on('event', console.log);

adapter.on('listened', () => {
  console.log('listening...');
});

adapter.listen();