# Mi.py
[![CodeFactor](https://www.codefactor.io/repository/github/yupix/mi.py/badge)](https://www.codefactor.io/repository/github/yupix/mi.py)
[![buddy pipeline](https://app.buddy.works/yupi0982/mi-py/pipelines/pipeline/345007/badge.svg?token=b304dd68d3eeb7917d453a2d2102621123ae4f05e0b659dde59cad486e2984b3 "buddy pipeline")](https://app.buddy.works/yupi0982/mi-py/pipelines/pipeline/345007)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyupix%2FMi.py.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fyupix%2FMi.py?ref=badge_shield)
## 使い方
<details>
<summary>クラスを継承したBOT作り</summary>
```python
from misskey.ext import task
from misskey.reaction import Reaction
from misskey.message import Message
from misskey.router import Router
from misskey.bot import Bot
class SakuraAoi(Bot):
@task.loop(60)
async def task(self, ws):
print(ws)
print('ループしてますよ~')
async def on_ready(self, ws):
print('work on my machine')
await Router(ws).channels(['global', 'main'])
self.task.start()
async def on_message(self, ws, ctx: Message):
print(f'{ctx.note.author.instance.name} | {ctx.note.author.username}さんがノートしました: {ctx.note.text}')
async def on_reacted(self, ws, ctx: Reaction):
print(ctx.note.reaction)
async def on_deleted(self, ws, ctx: Message):
print(ctx)
async def on_error(self, err):
print(err)
if __name__ == '__main__':
url = 'wss://exmaple.com/streaming'
SakuraAoi().run(url, 'token')
```
</details>
<details>
<summary>インスタンス化してイベントを登録するスタイル</summary>
```python
from misskey.message import Message
from misskey.router import Router
from misskey.bot import Bot
bot = Bot()
@bot.listen()
async def on_message(ws, ctx: Message):
print(f'{ctx.note.author.instance.name} | {ctx.note.author.username}さんがノートしました: {ctx.note.text}')
@bot.listen()
async def on_reaction(ws, ctx):
print(f'{ctx.note.author.instance.name} | {ctx.author.name}さんがリアクションを付けました: {ctx.note.text}')
@bot.event()
async def on_ready(ws):
print('work on my machine')
await Router(ws).channels(['global', 'main'])
bot.run('wss:/example.com', 'token')
```
</details>
### Collaborators
<table>
<tr>
<td><img src="https://avatars.githubusercontent.com/u/50538210?s=120&v=4"></img></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/yupix">Author | @yupix</a></td>
</tr>
</table>
### SpecialThanks
開発を手伝ってくれている方々です。
<table>
<tr>
<td><img src="https://avatars.githubusercontent.com/u/26793720?s=120&v=4"></img></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Uraking-Github">Adviser | @Uraking</a></td>
</tr>
</table>
# LICENSE
[Mi.py](LICENSE.md)
[Credit](COPYING.md)
[Third party](LICENSE/ThirdPartyLicense.md)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyupix%2FMi.py.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fyupix%2FMi.py?ref=badge_large)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
mi.py-0.0.2.tar.gz (25个子文件)
mi.py-0.0.2
PKG-INFO 5KB
misskey
reaction.py 415B
http.py 3KB
message.py 569B
user.py 741B
router.py 2KB
__init__.py 704B
ext
messages
__init__.py 0B
context.py 0B
__init__.py 21B
task
__init__.py 549B
context.py 126B
note.py 2KB
instance.py 610B
bot.py 4KB
setup.cfg 42B
setup.py 880B
LICENSE.md 1KB
mi.py.egg-info
PKG-INFO 5KB
requires.txt 11B
SOURCES.txt 481B
top_level.txt 8B
dependency_links.txt 1B
README.md 3KB
COPYING.md 354B
共 25 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功