# MiPA
[](https://github.com/astral-sh/ruff)
## 概要
[English](./README.md)
MiPA は[Discord.py](https://github.com/Rapptz/discord.py)
ライクな書き方ができるように作っている Misskey Bot Frameworkです。
## MiPACについて
MiPAが提供するApi Wrapperとしての機能は [MiPAC](https://github.com/yupix/mipac) と呼ばれるライブラリで管理されています。MiPAと比較して作業量が非常に多いため一緒に作業をしてくださる方を募集しています。
## サポートしているMisskey
- [Misskey Official v13](https://github.com/misskey-dev/misskey)
- [Misskey Official v12](https://github.com/misskey-dev/misskey)
- [Misskey Official v11](https://github.com/misskey-dev/misskey)
### Examples
```py
import asyncio
from aiohttp import ClientWebSocketResponse
from mipac.models.note import Note
from mipa.ext.commands.bot import Bot
class MyBot(Bot):
def __init__(self):
super().__init__()
async def _connect_channel(self):
await self.router.connect_channel(['main', 'home'])
async def on_ready(self, ws: ClientWebSocketResponse):
await self._connect_channel()
print('Logged in ', self.user.username)
async def on_reconnect(self, ws: ClientWebSocketResponse):
await self._connect_channel()
async def on_note(self, note: Note):
print(note.author.username, note.content)
if __name__ == '__main__':
bot = MyBot()
asyncio.run(bot.start('wss://example.com/streaming', 'your token here'))
```
より多くの例は [examples フォルダ](examples) をご覧ください。もしexamplesであなたのしたいことが分からなかった場合は遠慮なくIssueを作成してください。
## LICENSE
このプロジェクトは [MIT LICENSE](./LICENSE) で提供されます。
MiPAでは多くの部分においてDiscord.pyを参考にさせていただきました。そのため、Discord.pyのソースコードを利用させていただいている個所ではファイルの初めにDiscord.py側のライセンスを明記しています。詳しくはコードを確認してください。
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fyupix%2FMiPA?ref=badge_large)
## Special Thanks
- [Discord.py](https://github.com/Rapptz/discord.py)
- Cogの仕組みやtask,stateの管理等多くの部分で参考にさせていただきました。