From 3f927c402d42f033faeff3c4dc6aee60b3e73441 Mon Sep 17 00:00:00 2001 From: Misaka12456 Date: Wed, 12 Aug 2020 08:44:44 +0800 Subject: [PATCH] 0.0.2 Release Ready(6) --- src/org/ots123it/JMirai/Mirai.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/org/ots123it/JMirai/Mirai.java b/src/org/ots123it/JMirai/Mirai.java index a23b1e1..4cb8059 100644 --- a/src/org/ots123it/JMirai/Mirai.java +++ b/src/org/ots123it/JMirai/Mirai.java @@ -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() {