mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-12-15 22:50:47 +00:00
[Add] BotEventHandler 增加启动预处理方法;
[Add] BotAdminCommandProcess 增加推送功能相关管理命令; [Change] RandomIntervalSendTimer 调整Timer管理过程; [Change] BotCommandProcess ranking方法对参数错误的处理调整为返回错误信息; [Fix] RankingUpdateTimer 修复参数错误的问题;
This commit is contained in:
@ -175,18 +175,22 @@ public class BotCommandProcess {
|
||||
}
|
||||
}
|
||||
|
||||
PixivURL.RankingMode mode = PixivURL.RankingMode.MODE_DAILY;
|
||||
PixivURL.RankingMode mode;
|
||||
try {
|
||||
mode = PixivURL.RankingMode.valueOf("MODE_" + contentMode.toUpperCase());
|
||||
String rankingModeValue = contentMode.toUpperCase();
|
||||
mode = PixivURL.RankingMode.valueOf(rankingModeValue.startsWith("MODE_") ? rankingModeValue : "MODE_" + rankingModeValue);
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("无效的RankingMode值: {}", contentMode);
|
||||
return "参数无效, 请查看帮助信息";
|
||||
}
|
||||
|
||||
PixivURL.RankingContentType type = PixivURL.RankingContentType.TYPE_ILLUST;
|
||||
PixivURL.RankingContentType type;
|
||||
try {
|
||||
type = PixivURL.RankingContentType.valueOf("TYPE_" + contentType.toUpperCase());
|
||||
String contentTypeValue = contentType.toUpperCase();
|
||||
type = PixivURL.RankingContentType.valueOf(contentTypeValue.startsWith("TYPE_") ? contentTypeValue : "TYPE_" + contentTypeValue);
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("无效的RankingContentType值: {}", contentType);
|
||||
return "参数无效, 请查看帮助信息";
|
||||
}
|
||||
|
||||
if(!type.isSupportedMode(mode)) {
|
||||
|
||||
Reference in New Issue
Block a user