yupix / mipa Goto Github PK
View Code? Open in Web Editor NEWPython Misskey Bot Framework
Home Page: https://mipa.akarinext.org/api
License: MIT License
Python Misskey Bot Framework
Home Page: https://mipa.akarinext.org/api
License: MIT License
こんにちは、使いやすいライブラリをご提供いただき、とても助かっています。
概要: Misskey サーバ側が原因で WebSocket 接続が切断された際に、reconnect=True
の場合にも自動的に再接続されていないような挙動をする
サーバ側起因の問題で意図的に再現させることができないため、まだ十分に調査ができておりません。現在は client.py
の connect
, _connect
周りにブレークポイントを入れながら再現時の挙動を確認中です。
引き続き調査をしてみようと思いますが、もし既知の問題や良い調査方法などありましたらコメントいただけますと幸いです。
Related to yupix/MiPAC#7
The framework uses an incorrect URL for the streaming API. The streaming API documentation can be found at: https://misskey-hub.net/docs/api/streaming
wrong: wss://misskey.example/?i={token}
correct: wss://misskey.example/streaming?i={token}
I think this line needs to be changed:
Line 66 in e53ee61
It only works because Misskey is currently permissive about which URL you use. Foundkey (a fork of Misskey) is more restrictive and only allows the path /streaming
that is defined in the documentation.
破壊的変更になるかもだけど、現状のよりはよくなると信じたい。
0.3.2だと一度に1つのチャンネルにつき1つしか接続を生やせない。正直これでも通常用途なら問題ないと思うけど、paramsとかをサポートするってなると念のために同時に複数同じチャンネルに接続できるようにしたい
これやるならどうせだったら、配列の中に辞書入れるみたいな感じでもいいかも
I am in the process of implementing the new File feature.
In the example there is the code await client.action.note.action.send(files=[MiFile(file_id=random.choice(all_file).id)])
But using the files
parameter with await note.reply(content=text, files=[MiFile(file_id=random.choice(all_file).id)])
throws an "Unknown parameter" warning.
Also await client.action.drive.action.get_folders()
throws the error below. Also copied from the example.
File "/home/ente/git/Misskey-Bot-CeilingFox/cfbot.py", line 59, in on_mention
folders = await self.client.action.drive.action.get_folders()
AttributeError: 'ClientActions' object has no attribute 'action'
Used example: https://gist.github.com/yupix/297160c1a2bd68704cec38299fa2f827
kwargsで対処したつもりがそもそもキーワード引数じゃなかったので多分起きてる問題。
Misskey may have changed something about their API, but I'm getting this error in Ente's misskey-ebooks-bot that uses MiPA with Misskey v12.112.3:
misskey-ebooks | connections: ['[(<aiohttp.client_proto.ResponseHandler object at address>, numbers)]']
misskey-ebooks | connector: <aiohttp.connector.TCPConnector object at address>
misskey-ebooks | Traceback (most recent call last):
misskey-ebooks | File "/usr/src/app/rdbot.py", line 68, in <module>
misskey-ebooks | asyncio.run(bot.start(url, token))
misskey-ebooks | File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
misskey-ebooks | return loop.run_until_complete(main)
misskey-ebooks | File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
misskey-ebooks | return future.result()
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipa/client.py", line 257, in start
misskey-ebooks | await self.login(token, origin_url)
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipa/client.py", line 189, in login
misskey-ebooks | await api.http.login()
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipac/http.py", line 102, in login
misskey-ebooks | data = await self.request(Route('POST', '/api/i'), auth=True)
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipac/http.py", line 95, in request
misskey-ebooks | raise APIError(data)
misskey-ebooks | mipac.exception.APIError: None
misskey-ebooks | Unclosed client session
misskey-ebooks | client_session: <aiohttp.client.ClientSession object at address>
misskey-ebooks | Unclosed connector
misskey-ebooks | connections: ['[(<aiohttp.client_proto.ResponseHandler object at address>, numbers)]']
misskey-ebooks | connector: <aiohttp.connector.TCPConnector object at address>
misskey-ebooks | Traceback (most recent call last):
misskey-ebooks | File "/usr/src/app/rdbot.py", line 68, in <module>
misskey-ebooks | asyncio.run(bot.start(url, token))
misskey-ebooks | File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
misskey-ebooks | return loop.run_until_complete(main)
misskey-ebooks | File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
misskey-ebooks | return future.result()
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipa/client.py", line 257, in start
misskey-ebooks | await self.login(token, origin_url)
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipa/client.py", line 190, in login
misskey-ebooks | self.user = await api.action.get_me()
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipac/manager/client.py", line 42, in get_me
misskey-ebooks | return await self.user.action.get_me()
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipac/actions/user.py", line 45, in get_me
misskey-ebooks | return User(RawUser(res), client=self.__client)
misskey-ebooks | File "/usr/local/lib/python3.10/site-packages/mipac/core/models/user.py", line 150, in __init__
misskey-ebooks | self.id: str = data['user_id'] if data.get('user_id') else data['id']
misskey-ebooks | AttributeError: 'NoneType' object has no attribute 'get'
misskey-ebooks | Unclosed client session
misskey-ebooks | client_session: <aiohttp.client.ClientSession object at address>
misskey-ebooks | Unclosed connector
misskey-ebooks | connections: ['[(<aiohttp.client_proto.ResponseHandler object at address>, numbers)]']
misskey-ebooks | connector: <aiohttp.connector.TCPConnector object at address>
以下のようなブランチ構造に変える
develop: 最新のMisskeyのみ対応
v12: v12のみ対応
v11: v11のみ対応
MiPAのCoreライブラリであるMiPACをバージョンごとに開発することでインスタンスのバージョンにあった機能のみを提供でき、ライブラリ利用者のDX向上や保守する際にかかる負担が軽減するため。詳しくは次のIssueを
yupix/MiPAC#94
なるべく早くやりたいところではありますが、少なくともMiPACのMisskey最新に対応させる作業が終わるまでは作業を行わない見込みです(破壊的変更が多数あるため都度都度やってると時間が掛かってしまうため)
developをv13向けにしちゃいたい
yupix/MiPAC#109 が終わったらやりたい、現状破壊的変更がまだありそうだから今作業してもまた作業することになりそう
MiPACと同等レベルまで開発環境を整える
現状のイベント実装色々と古そう
Sphinxを用いてドキュメントを追加する予定
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.