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 です

注意

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

開発者向け情報

このプロジェクトでは 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.0.tar.gz (36.9 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.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mipa-0.2.0.tar.gz
  • Upload date:
  • Size: 36.9 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.0.tar.gz
Algorithm Hash digest
SHA256 fd0361703617f4f8f76f3b5f27e26abda6eb4528e71bf171c3e125488e03db5c
MD5 21d15ec655b999afc69ef73f2384590a
BLAKE2b-256 7b34065b19a8f905ae258d586f7c9bf14ace6d1d87420166e551abd4b81f450d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mipa-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04cb3013fc0627172f711277a341b3faae358ee7ed1e91405e07b5d453c5ada3
MD5 332fdab6f63ffdb8976b592f64984a1a
BLAKE2b-256 7114f4159db750ac8c5438a94130d365fc56a670583dc9f4966fea217b3cfdf8

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