摸鱼派 API Package
摸鱼派社区 (https://fishpi.cn/) 的 API Package,可以快速开发出一款应用支援社区功能。
支援
- 用户信息;
- 聊天室;
- 自定义表情包;
- 文件上传;
- 通知信息;
- 清风明月;
安装
npm install fishpi
用例
import FishPi from 'fishpi';
let apiKey = '';
let fish = new FishPi();
let rsp = await fish.login({
username: 'username',
passwd: 'password123456'
});
if (rsp.code == 0) apiKey = rsp.Key;
let fish = new FishPi(apiKey);
console.dir(await fish.account.info());
let emojis = await fish.emoji.get();
let defaultEmoji = fish.emoji.default;
fish.chatroom.addListener((ev:any) => console.dir(ev));
await fish.chatroom.send('Hello World!');
await fish.chatroom.redpacket.send({
type: 'random';
money: 32;
count: 2;
msg: '摸鱼者,事竟成!';
recivers: [];
})