You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
yupix 93fc86dae4
feat: v0.3.4をリリース
8 months ago
.github/workflows feat: change python version 2 years ago
cogs feat!: 多くのメソッドを非同期に 1 year ago
examples feat: 分割タイムラインの例をexamplesに追加 8 months ago
mipa fix: kwargsを使うように 8 months ago
.editorconfig feat: add .editorconfig 2 years ago
.flake8 feat: support all notifications #MA-11 2 years ago
.gitattributes feat: バージョン管理にgitを使うように 2 years ago
.gitignore feat: 分割タイムラインの例をexamplesに追加 8 months ago
.onedev-buildspec.yml chore: edit .onedev-buildspec.yml 2 years ago
CHANGELOG.md feat: v0.3.4をリリース 8 months ago
LICENSE chore: add LICENSE 2 years ago
MANIFEST.in feat: バージョン管理にgitを使うように 2 years ago
README.md docs: デフォルトのREADMEを英語に 8 months ago
README_JP.md docs: デフォルトのREADMEを英語に 8 months ago
pyproject.toml chore: blackからruffに 8 months ago
requirements.txt chore: update mipac 12 months ago
setup.cfg feat: バージョン管理にgitを使うように 2 years ago
setup.py chore: blackからruffに 8 months ago
versioneer.py feat: バージョン管理にgitを使うように 2 years ago

README.md

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