GraiaProject / Application

一个设计精巧, 协议实现完备的, 基于 mirai-api-http 的即时聊天软件自动化框架.
https://graia-document.vercel.app/
GNU Affero General Public License v3.0
438 stars 63 forks source link

[功能请求]群成员邀请新成员加入事件可以捕捉到嘛 #26

Closed aboutmydreams closed 4 years ago

aboutmydreams commented 4 years ago

似乎只有a申请,管理员b同意后才被MemberJoinEvent监听到

GreyElaina commented 4 years ago

如果机器人作为普通成员, 则无法监听.

aboutmydreams commented 4 years ago

好的,谢谢秒回,另外MemberJoinEvent好像需要一个group的返回才更合理

class MemberJoinEvent(MiraiEvent):
    type = "MemberJoinEvent"
    member: Member

    class Dispatcher(BaseDispatcher):
        mixin = [ApplicationDispatcher]

        @staticmethod
        def catch(interface: DispatcherInterface):
            if interface.annotation is Member:
                return interface.event.member
GreyElaina commented 4 years ago

MemberJoinEvent.member.group

aboutmydreams commented 4 years ago

sorry, thanks