新增摸鱼模块

测试大头菜
This commit is contained in:
2022-04-08 16:42:08 +08:00
parent d35b1bdc42
commit 4cbcba6b6e
4 changed files with 62 additions and 1 deletions

View File

@@ -64,10 +64,12 @@ public class TurnipProphet extends Model {
@Override
public void onMessage(Long qq, MessageEvent event, boolean isGroup) {
super.onMessage(qq, event, isGroup);
System.out.println("测试大头菜");
user = qq;
sendQQ = qq;
if (isGroup) {
if (!event.getMessage().serializeToMiraiCode().contains("[mirai:at:2476945931]")) {
System.out.println("没有@");
return;
}
user = event.getSource().getFromId();
@@ -75,7 +77,7 @@ public class TurnipProphet extends Model {
int money = -1;
try {
if (isGroup) {
msg = msg.replace("@2476945931", "");
msg = msg.replace("@2476945931", "").trim();
}
money = Integer.parseInt(msg.trim());
} catch (Exception e) {
@@ -88,6 +90,7 @@ public class TurnipProphet extends Model {
}
private void showData() {
System.out.println("发送数据");
String redisKey = user + "_turnip";
String data = RedisTools.get(redisKey);
if (StringUtils.isEmpty(data)) {