Skip to content

Commit

Permalink
chore(mirai): update mirai version to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aowubulao committed Jan 19, 2021
1 parent 517181a commit f1b6e28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

查询明日方舟地图及物品的掉落统计,数据来源:[企鹅物流数据统计](https://penguin-stats.io/)

适配mirai-console1.x以及2.0-m2
适配mirai-console1.x以及2.0.0

**mirai-console1.0请下载releases中的0.x版本**[arknights-drop-plugin-0.0.2](https://github.com/aowubulao/arknights-drop-plugin/releases/tag/v0.0.2)

**mirai-console2.0请下载releases中的1,x版本**[arknights-drop-plugin-1.0.0](https://github.com/aowubulao/arknights-drop-plugin/releases/tag/v1.0.0)
**mirai-console2.0请下载releases中的1.x版本**[arknights-drop-plugin-1.0.1](https://github.com/aowubulao/arknights-drop-plugin/releases/tag/v1.0.1)

### 2、使用

1)下载:https://github.com/aowubulao/arknights-drop-plugin/releases

2)下载后放入plugins文件夹

3)启动mirai-console,启动后请等待插件加载数据,时间大概在20s-70s
3)启动mirai-console,启动后请等待插件加载数据

4)指令:

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>com.neoniou.bot</groupId>
<artifactId>arknights-drop-plugin</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand All @@ -19,13 +19,13 @@
<dependency>
<groupId>net.mamoe</groupId>
<artifactId>mirai-console</artifactId>
<version>2.0-M2</version>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.mamoe</groupId>
<artifactId>mirai-core-jvm</artifactId>
<version>2.0-M2-2</version>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
16 changes: 5 additions & 11 deletions src/main/java/com/neoniou/bot/ArkDropPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
import com.neoniou.bot.utils.ThreadUtil;
import net.mamoe.mirai.console.plugin.jvm.JavaPlugin;
import net.mamoe.mirai.console.plugin.jvm.JvmPluginDescriptionBuilder;
import net.mamoe.mirai.event.EventHandler;
import net.mamoe.mirai.event.Events;
import net.mamoe.mirai.event.SimpleListenerHost;
import net.mamoe.mirai.event.GlobalEventChannel;
import net.mamoe.mirai.event.events.FriendMessageEvent;
import net.mamoe.mirai.event.events.GroupMessageEvent;
import net.mamoe.mirai.utils.MiraiLogger;
Expand Down Expand Up @@ -36,15 +34,11 @@ public void onEnable() {
ThreadUtil.createDefaultThreadPool(3);
ThreadUtil.execute(StatusTotal::initStatus);

Events.registerEvents(this, new SimpleListenerHost(this.getCoroutineContext()) {
@EventHandler
public void onGroup(GroupMessageEvent event) {
ThreadUtil.execute(() -> CommonMessageHandler.handleGroupMessage(event));
}
GlobalEventChannel.INSTANCE.subscribeAlways(FriendMessageEvent.class, event -> ThreadUtil.execute(() -> CommonMessageHandler.handleFriendMessage(event)));

@EventHandler
public void onFriend(FriendMessageEvent event) {
ThreadUtil.execute(() -> CommonMessageHandler.handleFriendMessage(event));
GlobalEventChannel.INSTANCE.subscribeAlways(GroupMessageEvent.class, event -> {
if (event.getGroup().getBotMuteRemaining() == 0) {
ThreadUtil.execute(() -> CommonMessageHandler.handleGroupMessage(event));
}
});
}
Expand Down

0 comments on commit f1b6e28

Please sign in to comment.