Skip to content

Commit

Permalink
0.0.2 Release Ready(6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Misaka12456 committed Aug 12, 2020
1 parent 7296682 commit 3f927c4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/org/ots123it/JMirai/Mirai.java
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,30 @@ public void setRequestGroupAdd(MemberJoinRequestEvent event,int processType,Stri
}
}

/**
* 处理Bot被邀请入群请求。
* @param event 原请求事件
* @param processType 处理类型(0=通过请求,1=忽略请求)
* @throws OperationNotSupportedException 无效的处理类型
*/
public void setRequestBotInviteJoinGroup(BotInvitedJoinGroupRequestEvent event,int processType)
{
try {
switch (processType)
{
case 0: //允许
event.accept();
break;
case 1: //忽略
event.ignore();
default:
throw new OperationNotSupportedException("processType is invalid");
}
} catch (Exception e) {
logError(MiraiAppAbstract.selfApp.getPluginName$mirai_console(), e.getMessage());
}
}

@Override
public String toString()
{
Expand Down

0 comments on commit 3f927c4

Please sign in to comment.