优化B站直播间每日签到提示文本
This commit is contained in:
parent
3bc4c164e0
commit
943a2c9334
@ -18,6 +18,17 @@ public class AppUserTask {
|
||||
private long weekGroup;
|
||||
private DayTask dayTask;
|
||||
|
||||
public static String toMessageFormat(AppUserTask oldTask, AppUserTask newTask) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("当前电池数量:").append(String.format("%.2f → %.2f",
|
||||
(double) oldTask.wallet.gold / 100,
|
||||
(double) newTask.wallet.gold / 100)
|
||||
).append("\n");
|
||||
sb.append("当前银瓜子数量:").append(newTask.wallet.silver).append("\n");
|
||||
sb.append("每日领取电池:").append(newTask.dayTask.toMessageFormat()).append("\n");
|
||||
newTask.weekTask.forEach(task -> sb.append(task.toMessageFormat(newTask.weekTotal)).append("\n"));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String toMessageFormat() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -13,8 +13,8 @@ import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
public class BiliBiliManga {
|
||||
public BiliBiliManga() {
|
||||
biliUtils = BiliBiliUtils.getInstance(QQBotManager.defQQ);
|
||||
public BiliBiliManga(long qq) {
|
||||
biliUtils = BiliBiliUtils.getInstance(qq);
|
||||
}
|
||||
|
||||
public static JSONObject sign() {
|
||||
|
@ -39,7 +39,7 @@ public class BiliBiliLive extends Model {
|
||||
public synchronized void onTime(Long qq, String time) {
|
||||
super.onTime(qq, time);
|
||||
if ("00:01:00".equals(time)) {
|
||||
if(!new BiliLogin(qq).testLogin()){
|
||||
if (!new BiliLogin(qq).testLogin()) {
|
||||
new BiliLogin(QQBotManager.defQQ).loginAsQQ();
|
||||
return;
|
||||
}
|
||||
@ -48,7 +48,7 @@ public class BiliBiliLive extends Model {
|
||||
}
|
||||
|
||||
private void signLive(long qq, long sendQQ) {
|
||||
if(!new BiliLogin(qq).testLogin()){
|
||||
if (!new BiliLogin(qq).testLogin()) {
|
||||
new BiliLogin(qq).loginAsQQ();
|
||||
return;
|
||||
}
|
||||
@ -66,9 +66,11 @@ public class BiliBiliLive extends Model {
|
||||
builder.append("BiliLiveSign").append(id).append(":").append(sign).append("\n");
|
||||
}
|
||||
QQBotManager.getInstance().sendMessage(sendQQ, builder.toString());
|
||||
AppUserTask task = new BiliBiliAppUtils(QQBotManager.defQQ).startAppTask();
|
||||
BiliBiliAppUtils appUtils = new BiliBiliAppUtils(QQBotManager.defQQ);
|
||||
AppUserTask oldTask = appUtils.startAppTask();
|
||||
AppUserTask newTask = appUtils.getTaskProgress();
|
||||
builder = new StringBuilder();
|
||||
builder.append("执行APP任务").append("\n").append(task.toMessageFormat());
|
||||
builder.append("执行APP任务").append("\n").append(AppUserTask.toMessageFormat(oldTask, newTask));
|
||||
QQBotManager.getInstance().sendMessage(sendQQ, builder.toString());
|
||||
}
|
||||
|
||||
@ -99,7 +101,7 @@ public class BiliBiliLive extends Model {
|
||||
msg = "0";
|
||||
}
|
||||
Integer roomId = Integer.parseInt(msg);
|
||||
if(!new BiliLogin(qq).testLogin()){
|
||||
if (!new BiliLogin(qq).testLogin()) {
|
||||
new BiliLogin(qq).loginAsQQ();
|
||||
return;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import com.yutou.qqbot.utlis.QRCodeUtils;
|
||||
import net.mamoe.mirai.event.events.MessageEvent;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@UseModel
|
||||
public class BiliBiliMangeSign extends Model {
|
||||
@Override
|
||||
@ -34,6 +35,7 @@ public class BiliBiliMangeSign extends Model {
|
||||
@Override
|
||||
public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
|
||||
super.onMessage(qq, event, isGroup);
|
||||
BiliBiliManga manga = new BiliBiliManga(user);
|
||||
if (msg.equals(QQFromCommands.BILI_MANGA_SIGN)) {
|
||||
String msg;
|
||||
if (new BiliLogin(user).testLogin()) {
|
||||
@ -70,8 +72,8 @@ public class BiliBiliMangeSign extends Model {
|
||||
}
|
||||
QQBotManager.getInstance().sendMessage(qq, builder.toString());
|
||||
} else if (msg.equals(QQFromCommands.BILI_MANGA_PAY_STOP)) {
|
||||
new BiliBiliManga().stopPayMission();
|
||||
QQBotManager.getInstance().sendMessage(qq, "当前任务已取消:"+BiliBiliManga.getMission());
|
||||
manga.stopPayMission();
|
||||
QQBotManager.getInstance().sendMessage(qq, "当前任务已取消:" + BiliBiliManga.getMission());
|
||||
} else if (msg.startsWith(QQFromCommands.BILI_MANGA_PAY)) {
|
||||
msg = msg.replace(QQFromCommands.BILI_MANGA_PAY, "");
|
||||
String[] message = msg.split(" ");
|
||||
@ -97,7 +99,7 @@ public class BiliBiliMangeSign extends Model {
|
||||
QQBotManager.getInstance().sendMessage(qq, "商城id错误");
|
||||
return;
|
||||
}
|
||||
BiliBiliManga manga = new BiliBiliManga();
|
||||
|
||||
manga.addInterface(new ObjectInterface() {
|
||||
@Override
|
||||
public void out(String data) {
|
||||
@ -113,8 +115,8 @@ public class BiliBiliMangeSign extends Model {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTime(Long qq,String time) {
|
||||
super.onTime(qq,time);
|
||||
public void onTime(Long qq, String time) {
|
||||
super.onTime(qq, time);
|
||||
if ("00:01:00".equals(time)) {
|
||||
if (new BiliLogin(QQBotManager.defQQ).testLogin()) {
|
||||
String msg;
|
||||
|
Loading…
Reference in New Issue
Block a user