Git Product home page Git Product logo

mipa's People

Contributors

fossabot avatar momentqyc avatar normikoto avatar omg-xtao avatar yuma-m avatar yupix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mipa's Issues

サーバ側から切断された際に WebSocket が再接続しない(ように見える)

こんにちは、使いやすいライブラリをご提供いただき、とても助かっています。

概要: Misskey サーバ側が原因で WebSocket 接続が切断された際に、reconnect=True の場合にも自動的に再接続されていないような挙動をする

サーバ側起因の問題で意図的に再現させることができないため、まだ十分に調査ができておりません。現在は client.pyconnect, _connect 周りにブレークポイントを入れながら再現時の挙動を確認中です。

引き続き調査をしてみようと思いますが、もし既知の問題や良い調査方法などありましたらコメントいただけますと幸いです。

incorrect URL for streaming API

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:

f'{client.url}?i={client.token}'

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とかをサポートするってなると念のために同時に複数同じチャンネルに接続できるようにしたい

Files can't be added with `note.reply()`

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

AttributeError: 'NoneType' object has no attribute 'get'

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>

Misskeyのメジャーバージョンごとにブランチを分けて開発する

What

以下のようなブランチ構造に変える

develop: 最新のMisskeyのみ対応
v12: v12のみ対応
v11: v11のみ対応

Why

MiPAのCoreライブラリであるMiPACをバージョンごとに開発することでインスタンスのバージョンにあった機能のみを提供でき、ライブラリ利用者のDX向上や保守する際にかかる負担が軽減するため。詳しくは次のIssueを
yupix/MiPAC#94

いつやるか

なるべく早くやりたいところではありますが、少なくともMiPACのMisskey最新に対応させる作業が終わるまでは作業を行わない見込みです(破壊的変更が多数あるため都度都度やってると時間が掛かってしまうため)

readmeを整理する

  • デフォルト言語を英語に
  • 使用してるプロジェクトなどを消す
  • 宣伝っぽいものを消し、シンプルに
  • api wrapperからbot frameworkに統一する

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.