# mirainya2

> Mirai Typescript SDK for mirai-api-http^2.x

Latest version **1.2.0** (published 2021-10-21) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install mirainya2
pnpm add mirainya2
yarn add mirainya2
bun add mirainya2
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2021-10-21 |
| First published | 2021-09-23 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 91.3 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | enzymii |
| Maintainers | enzymii |

## Links

- npm: https://www.npmjs.com/package/mirainya2
- Repository: https://github.com/enzymii/mirainya2
- npm.io page: https://npm.io/package/mirainya2

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.21.4
- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [dateformat](https://npm.io/package/dateformat.md) ^4.5.1

## Recent versions

- 1.2.0 (latest) — 2021-10-21
- 1.1.0 — 2021-10-21
- 1.0.2 — 2021-09-23
- 1.0.1 — 2021-09-23
- 1.0.0 — 2021-09-23

## README

# mirainya2

[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

A new version of typescript QQ bot SDK based on `mirai-api-http v2`

This repo is under quite slow construction

Trying my best to make progress every day

## Usage

Firstly you need to guarantee that you have the `mirai-api-http^2` env

I have published it by yarn, so you can use

```sh
yarn install mirainya2
```

An example program can be:

```ts
import { Bot, Logger, MakeMsg } from 'mirainya2';

const main = async (): Promise<void> => {
  const myBot = new Bot(botConfig); // the sample of botConfig can be found in ./src/config_sample

  await myBot.initialize();
  await myBot.login();

  myBot.listen(async (msg) => {
    Logger.log(JSON.stringify(msg));
    if (msg.type === 'FriendMessage') {
      await myBot.api?.sendFriendMessage(msg.sender.id, [MakeMsg.plain('QAQ')]);
    }
  }, 'msg');
};

main();
```

_Welcome contribution_

---
_Source: https://npm.io/package/mirainya2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
