摸鱼派 API Python Package
趁着昨晚有空,终于把摸鱼派 Python Package 写完发布了。Node 版本看这里
GitHub: https://github.com/imlinhanchao/fishpi-py
PyPl: https://pypi.org/project/fishpi/
安装
pip install fishpi
用例
from fishpi import FishPi
# 登录获取 apiKey
apiKey = ''
fish = FishPi()
rsp = fish.login(
username='username',
passwd='password123456'
)
if rsp['code'] == 0:
apiKey = rsp.Key
# 通过 apiKey 获取登录用户信息
fish = FishPi(apiKey)
fish.account.info()
# 获取用户自定义表情包
emojis = fish.emoji.get()
# 获取默认表情包
defaultEmoji = fish.emoji.default
# 监听聊天室消息
fish.chatroom.addListener(lambda msg: print(msg))
# 向聊天室发送信息(需要登录)
fish.chatroom.send('Hello World!')
# 向聊天室发送红包
fish.chatroom.redpacket.send(
type='random',
money=32,
count=2,
msg='摸鱼者,事竟成!',
recivers=[]
)
这就是大佬的世界
这就是大佬的世界