1.2.0 • Published 3 years ago

mirainya2 v1.2.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
3 years ago

mirainya2

Commitizen friendly

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

yarn install mirainya2

An example program can be:

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

1.2.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago