Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make BotJoinGroupEvent.Active and .Invite inherit BotJoinGroupEvent #532

Merged
merged 1 commit into from Aug 23, 2020

Conversation

yyuueexxiinngg
Copy link
Contributor

BotJoinGroupEvent.Active, BotJoinGroupEvent.Invite事件继承BotJoinGroupEvent

目前, 下方测试代码中第一个whenblock不会被触发, 而类似事件如MemberJoinEventInviteActive都继承了其父类, 所以类似block可以正确触发

        bot.subscribeAlways<BotEvent> {
            when (this) {
                is BotJoinGroupEvent -> {
                    println("Bot Join Event !!!!!!!!!!!!!!!")
                    when (it) {
                        is BotJoinGroupEvent.Active -> println("1: Bot joined group: ${group.name}")
                        is BotJoinGroupEvent.Invite -> println("1: Bot joined group by invitation! Group: ${group.name}")
                    }
                }
                is BotJoinGroupEvent.Active -> println("2: Bot joined group: ${group.name}")
                is BotJoinGroupEvent.Invite -> println("2: Bot joined group by invitation! Group: ${group.name}")
            }
        }

@mzdluo123 mzdluo123 requested a review from Him188 August 23, 2020 06:38
@Him188 Him188 added this to the 1.3.0 milestone Aug 23, 2020
@Him188 Him188 added the t:bug 类型: bug label Aug 23, 2020
@Him188 Him188 merged commit f577a5f into mamoe:dev Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:bug 类型: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants