Skip to main content

A Python wrapper for the Misskey API

Reason this release was yanked:

not working some event parser

Project description

MiPA

Discord server invite Ruff

Overview

日本語版

MiPA is a Misskey Bot Framework created to allow for Discord.py-like coding.

About MiPAC

The API wrapper functionality provided by MiPA is managed by a library called MiPAC. Since the amount of work is significantly higher than that of MiPA, we are looking for people to work with us.

Supported Misskey Versions

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 _connect_channel(self):
      await self.router.connect_channel(['main', 'home'])

    async def on_ready(self, ws: ClientWebSocketResponse):
        await self._connect_channel()
        print('Logged in ', self.user.username)

    async def on_reconnect(self, ws: ClientWebSocketResponse):
        await self._connect_channel()

    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'))

For more examples, please see the examples folder. If you don't know how to do what you want in the examples, please feel free to create an issue.

LICENSE

This project is provided under the MIT LICENSE.

MiPA has been inspired by Discord.py in many ways. Therefore, in places where we use the source code of Discord.py, we specify the license of Discord.py at the beginning of the file. Please check the code for details.

FOSSA Status

Special Thanks

  • Discord.py
    • We have been inspired by many aspects of Discord.py, such as the mechanism of Cogs and the management of tasks and states.

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.3.4.tar.gz (37.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.3.4-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mipa-0.3.4.tar.gz
Algorithm Hash digest
SHA256 45cc596636b9cbe0f72a04c52f95325fb389cb26e61ebc46ddd5c66baeee7c4e
MD5 fa91345bd3d864c8102ba88dc3b77711
BLAKE2b-256 59a5b4d79b53f57ce3c519699f55032478b9d75ccc67d1845ddde9a40a51697c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mipa-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 53960dff6ca3dab55542658ff907088b561057a11d4a1806c5eb0acda617e1ed
MD5 749c0da956ff6e6410e18ead0a0eb62d
BLAKE2b-256 20cfee1ea14d134eb1ec0a8da49f5c9afdad6fc9da5b14770392ed58c4019cf7

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