Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Commit

Permalink
Release: 2.1
Browse files Browse the repository at this point in the history
Release: 2.1
  • Loading branch information
Muska-Ami authored Jan 7, 2023
2 parents 44cb60c + 7e7858e commit ebf7e42
Show file tree
Hide file tree
Showing 24 changed files with 241 additions and 51 deletions.
Binary file modified .gradle/7.4/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/7.4/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified .gradle/7.4/checksums/sha1-checksums.bin
Binary file not shown.
Binary file modified .gradle/7.4/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/7.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified .gradle/file-system.probe
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 58 additions & 22 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,45 @@ qwhitelist:
</details>
#### extra-configs/trchat.yml
<details>
<summary>点此展开/收起</summary>
```yaml
# 聊天转发
chat-forward:
# 需要转发的频道
channel:
- Normal
```
</details>
#### extra-configs/command-alias.yml
<details>
<summary>点此展开/收起</summary>
```yaml
# CatSero QQ CommandAlias Config
# Generate by CatSero [email protected]@

# 功能开关
# true | false
enable: false

# 别名列表
tps:
- ctps
list:
- clist
whitelist:
- cwl
```
</details>
#### Bot & Group & QQOp配置指南
<details>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "moe.xmcn.catsero"
version = "2.1-beta-2"
version = "2.1"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion config.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
environments {
prod {
plugin {
version = "2.1-beta-2"
version = "2.1"
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 5 additions & 0 deletions src/main/java/moe/xmcn/catsero/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ static void saveFiles() {
if (!new File(plugin.getDataFolder(), "extra-configs/trchat.yml").exists()) {
plugin.saveResource("extra-configs/trchat.yml", false);
}
if (!new File(plugin.getDataFolder(), "extra-configs/command-alias.yml").exists()) {
plugin.saveResource("extra-configs/command-alias.yml", false);
}
Logger.logLoader("Saved.");

Logger.logLoader("Saving default locale...");
Expand Down Expand Up @@ -608,6 +611,8 @@ class CFI {
static final FileConfiguration qqop_config = YamlConfiguration.loadConfiguration(mirai_qqop_file);
static final File ext_trchat_file = new File(plugin.getDataFolder(), "extra-configs/trchat.yml");
static final FileConfiguration ext_trchat_config = YamlConfiguration.loadConfiguration(ext_trchat_file);
static final File command_alias_file = new File(plugin.getDataFolder(), "extra-configs/command-alias.yml");
public static final FileConfiguration command_alias_config = YamlConfiguration.loadConfiguration(command_alias_file);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ public class OnGroupMessageRequestList implements Listener {
@EventHandler
public void onGroupMessage(MiraiGroupMessageEvent e) {
try {
String[] args = QPS.parse(e.getMessage());
String[] args = QPS.parse(e.getMessage(), "list");

if (args != null) {
// 条件
if (
Configuration.USES_CONFIG.GET_ONLINE_LIST.ENABLE
&& args[0].equalsIgnoreCase("list")
&& e.getBotID() == Configuration.Interface.getBotCode(Configuration.USES_CONFIG.GET_ONLINE_LIST.MIRAI.BOT)
&& e.getGroupID() == Configuration.Interface.getGroupCode(Configuration.USES_CONFIG.GET_ONLINE_LIST.MIRAI.GROUP)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,22 @@ public class OnGroupMessageRequestTPS implements Listener {

@EventHandler
public void onGroupMessageEvent(MiraiGroupMessageEvent e) {
String[] args = QPS.parse(e.getMessage());
String[] args = QPS.parse(e.getMessage(), "tps");

if (args != null) {
// 条件
if (
Configuration.USES_CONFIG.GET_TPS.ENABLE
&& args[0].equalsIgnoreCase("tps")
&& e.getBotID() == Configuration.Interface.getBotCode(Configuration.USES_CONFIG.GET_ONLINE_LIST.MIRAI.BOT)
&& e.getGroupID() == Configuration.Interface.getGroupCode(Configuration.USES_CONFIG.GET_ONLINE_LIST.MIRAI.GROUP)

) {
if (args.length == 2) {
if (args.length == 1) {
// 处理TPS
double tps = TPSCalculator.getTPS();
BigDecimal around_tps = BigDecimal.valueOf(tps).setScale(1, RoundingMode.HALF_UP);

switch (args[1]) {
switch (args[0]) {
case "accurate":
// 精确
MessageSender.sendGroup("TPS: " + tps, Configuration.USES_CONFIG.GET_TPS.MIRAI.BOT, Configuration.USES_CONFIG.GET_TPS.MIRAI.GROUP);
Expand Down
Loading

0 comments on commit ebf7e42

Please sign in to comment.