涩图模块:图源改成regular,减少图片大小

管理员模块:支持this关键词标识本群
This commit is contained in:
Yutousama 2022-04-17 15:47:12 +08:00
parent 10fd1d6863
commit 4dfbee6d08
3 changed files with 10 additions and 6 deletions

View File

@ -97,7 +97,11 @@ public class AdminMessage extends Message {
if (msgGroup.length <= 2) { if (msgGroup.length <= 2) {
addModel(msgGroup[1], null); addModel(msgGroup[1], null);
} else { } else {
addModel(msgGroup[1], msgGroup[2]); if("this".equals(msgGroup[1])){
addModel(sendQQ+"",msgGroup[2]);
}else {
addModel(msgGroup[1], msgGroup[2]);
}
} }
} }
} }

View File

@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication @SpringBootApplication
public class QQBotApplication { public class QQBotApplication {
public static final String version="QQBot v.1.2.16"; public static final String version="QQBot v.1.2.17";
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("version = " + version); System.out.println("version = " + version);
SpringApplication.run(QQBotApplication.class, args); SpringApplication.run(QQBotApplication.class, args);

View File

@ -44,15 +44,15 @@ public class GetSeTu extends Model {
if (isRun) { if (isRun) {
Log.i(event.getSource().getFromId() + " > " + msg); Log.i(event.getSource().getFromId() + " > " + msg);
String key = msg.replace("来点", "").replace("色图", "").replace("涩图", ""); String key = msg.replace("来点", "").replace("色图", "").replace("涩图", "");
String url = "https://api.lolicon.app/setu/v2?r18=0"; String url = "https://api.lolicon.app/setu/v2?r18=0&size=regular";
if (isR18) { if (isR18) {
url = "https://api.lolicon.app/setu/v2?r18=1"; url = "https://api.lolicon.app/setu/v2?r18=1&size=regular";
} }
if (!StringUtils.isEmpty(key)) { if (!StringUtils.isEmpty(key)) {
if (isR18) { if (isR18) {
url = "https://api.lolicon.app/setu/v2?tag=" + URLEncoder.encode(key, StandardCharsets.UTF_8) + "&r18=1"; url = "https://api.lolicon.app/setu/v2?tag=" + URLEncoder.encode(key, StandardCharsets.UTF_8) + "&r18=1&size=regular";
} else { } else {
url = "https://api.lolicon.app/setu/v2?tag=" + URLEncoder.encode(key, StandardCharsets.UTF_8) + "&r18=0"; url = "https://api.lolicon.app/setu/v2?tag=" + URLEncoder.encode(key, StandardCharsets.UTF_8) + "&r18=0&size=regular";
} }
} }
String ret = HttpTools.get(url); String ret = HttpTools.get(url);