Skip to main content

A Python wrapper for the Misskey API

Project description

MiPA

Discord server invite Code style: black

概要

MiPA はDiscord.py ライクな書き方ができるように作っている MisskeyApi wrapper です

注意

MiPACとの関係性について

MiPAはMiPACというライブラリに依存しています。これはMiPAのCore部分をまとめた物であり、基本的にはApiへのアクセス用メソッドなどを提供します。MiPAではMiPACのメソッド群をそのまま公開している為、MiPAC側で大きな変更が入るとMiPAを使用しているプロジェクトでもその影響を受ける可能性があります。そのため、CHANGELOG.md で MiPACのバージョンが変更された際はそのリリースノートへのリンクを添付しています。予めMiPAC側での変更を確認したうえでアップデートをお願いします。

  • このプロジェクトは開発中です。仕様が定まっていないため、破壊的変更が多いです。
  • 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!

使用者の方へ

MiPAで作ったBotなどをGitHubなどで公開している場合は、Issueなどに送信してくだされば、MiPAで作られている物に追加します。また、良ければBotのプロフィールなどにこのBotはMiPAで作成されているとの旨を記載してくださると嬉しいです。

MiPAで作られているもの

Bot

  • akari
    • 作者の yupix が作成しているBotです。クリーンアーキテクチャを用いているため、部分的に分かりにくい所があるかもしれません。

開発者向け情報

このプロジェクトでは blackのforkである、axblackを利用しています。主な違いはダブルクォートがデフォルトではなく、シングルクォートになっている点です

LICENSE

このプロジェクトは MIT LICENSE で提供されます。

MiPAでは多くの部分においてDiscord.pyを参考にさせていただきました。そのため、Discord.pyのソースコードを利用させていただいている個所ではファイルの初めにDiscord.py側のライセンスを明記しています。詳しくはコードを確認してください。

FOSSA Status

Special Thanks

  • Discord.py
    • Cogの仕組みやtask,stateの管理等多くの部分で参考にさせていただきました。

Documentation * Discord Server

Project details


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.2.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mipa-0.2.2-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file mipa-0.2.2.tar.gz.

File metadata

  • Download URL: mipa-0.2.2.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for mipa-0.2.2.tar.gz
Algorithm Hash digest
SHA256 222fee028bdf98ed0d5d5275ffa46820e6408c02d57f61ddf1ed0f3f071a025b
MD5 3f306514ed4e0fe1f2ea50eb4e9362c5
BLAKE2b-256 2fff753dccef5f3b133bd10fb895a49b32c14461276f89fdefd158a30c8990dd

See more details on using hashes here.

File details

Details for the file mipa-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: mipa-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for mipa-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a0eaf4cbbf2d15a6c786e35b7af7f31c335c59bd67030eed782639b0030910c
MD5 fd29ceb0ee34339c12ca8cb39db44634
BLAKE2b-256 18816b83aefa3ad897cf22903559ffdb8e47e83b0a52469f55865a67f5b53307

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page