A Python wrapper for the Misskey API
Project description
MiPA
概要
MiPA はDiscord.py ライクな書き方ができるように作っている MisskeyApi wrapper です
注意
- このプロジェクトは開発中です。仕様が定まっていないため、破壊的変更が多いです。
master
ブランチで使用しているmipacはGitHub
にあるmipacのdevelop
ブランチの物です。
サポートしているMisskey
Examples
import asyncio
from aiohttp import ClientWebSocketResponse
from mipac import Note
from mipac.models import ChatMessage
from mipa.ext.commands.bot import Bot
class MyBot(Bot):
def __init__(self):
super().__init__()
async def on_ready(self, ws: ClientWebSocketResponse):
await self.router.connect_channel(['main', 'home'])
print('Logged in ', self.user.username)
async def on_note(self, note: Note):
print(note.author.username, note.content)
async def on_chat(self, message: ChatMessage):
print(message.user.username, message.text)
if message.text == 'hello':
await self.client.chat.action.send(
f'hello! {message.user.username}',
user_id=message.user.id
)
if __name__ == '__main__':
bot = MyBot()
asyncio.run(bot.start('wss://example.com/streaming', 'your token here'))
Want more examples? Go to the examples folder! Want to know how to use a feature that isn't even here? Submit a request in an Issue!
開発者向け情報
このプロジェクトでは blackのforkである、axblackを利用しています。主な違いはダブルクォートがデフォルトではなく、シングルクォートになっている点です
LICENSE
このプロジェクトは MIT LICENSE で提供されます。
MiPAでは多くの部分においてDiscord.pyを参考にさせていただきました。そのため、Discord.pyのソースコードを利用させていただいている個所ではファイルの初めにDiscord.py側のライセンスを明記しています。詳しくはコードを確認してください。
Special Thanks
- Discord.py
- Cogの仕組みやtask,stateの管理等多くの部分で参考にさせていただきました。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mipa-0.2.1.tar.gz
(36.9 kB
view hashes)
Built Distribution
mipa-0.2.1-py3-none-any.whl
(28.8 kB
view hashes)