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.1.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.1-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mipa-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 87799205be746fa8dac66213839554aab10b46568753ef004f91f6e9a1c8cb9d
MD5 6242f6e71121b9c1bbd52a731afb1f15
BLAKE2b-256 ce627b83e8f3dee9644504427eb780b5370c9c7828855282db7a04aa472df94a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mipa-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d8aae4a350475436be5907ebcdd0b62efd7440f99e2d1a1acd8e093444891794
MD5 d9425c7cf44d8ac39a3c958cf0a1942c
BLAKE2b-256 8b90eb5a47e017d768d01a5e3e169d322ccdfa5ea80b34bccd998750be67a0d8

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