新增漫画购买功能

This commit is contained in:
Yutousama 2022-04-08 13:46:54 +08:00
parent fe16be6693
commit 82c130a506

View File

@ -61,27 +61,26 @@ public class BiliBiliMangeSign extends Model {
.append("\n") .append("\n")
.append("num=物品数量,缺省或-1为全部") .append("num=物品数量,缺省或-1为全部")
.append("\n"); .append("\n");
QQBotManager.getInstance().sendMessage(qq, builder.toString());
if (BiliBiliManga.isPayMission()) { if (BiliBiliManga.isPayMission()) {
builder.append("当前已有执行任务:").append(BiliBiliManga.getMission()); builder.append("当前已有执行任务:").append(BiliBiliManga.getMission());
QQBotManager.getInstance().sendMessage(qq, builder.toString());
} }
}else if(msg.equals(QQFromCommands.BILI_MANGA_PAY_STOP)){ QQBotManager.getInstance().sendMessage(qq, builder.toString());
} else if (msg.equals(QQFromCommands.BILI_MANGA_PAY_STOP)) {
new BiliBiliManga().stopPayMission(); new BiliBiliManga().stopPayMission();
QQBotManager.getInstance().sendMessage(qq,"当前任务已取消"); QQBotManager.getInstance().sendMessage(qq, "当前任务已取消");
} else if (msg.startsWith(QQFromCommands.BILI_MANGA_PAY)) { } else if (msg.startsWith(QQFromCommands.BILI_MANGA_PAY)) {
msg = msg.replace(QQFromCommands.BILI_MANGA_PAY, ""); msg = msg.replace(QQFromCommands.BILI_MANGA_PAY, "");
String[] message = msg.split(" "); String[] message = msg.split(" ");
int num = -1; int num = -1;
int id = 0; int id = 0;
for (String s : message) { for (String s : message) {
try{ try {
if(id==0){ if (id == 0) {
id=Integer.parseInt(s); id = Integer.parseInt(s);
}else if(num==-1){ } else if (num == -1) {
num=Integer.parseInt(s); num = Integer.parseInt(s);
} }
}catch (Exception ignored){ } catch (Exception ignored) {
} }
} }
@ -99,8 +98,8 @@ public class BiliBiliMangeSign extends Model {
@Override @Override
public void out(String data) { public void out(String data) {
super.out(data); super.out(data);
if(!data.startsWith("[2]")&&!data.startsWith("[4]")&&!data.startsWith("[1]")){ if (!data.startsWith("[2]") && !data.startsWith("[4]") && !data.startsWith("[1]")) {
QQBotManager.getInstance().sendMessage(qq,"任务异常:"+data); QQBotManager.getInstance().sendMessage(qq, "任务异常:" + data);
manga.stopPayMission(); manga.stopPayMission();
} }
} }