Yutou 7e9fa60f6a 新增图片支持File
调整涩图模块为先自己下载,无法下载再丢url给qq机器人
移除部分日志
2024-05-05 16:50:37 +08:00

54 lines
1.1 KiB
Java

package com.yutou.napcat.handle;
import lombok.Data;
import java.lang.reflect.Type;
public class Text extends BaseHandle<Text.TextInfo> {
public Text() {
super("text");
}
public Text(String text) {
super("text");
data = new TextInfo(text + "\n");
}
public Text(String text, boolean isNewLine) {
super("text");
if (isNewLine) {
data = new TextInfo(text + "\n");
} else {
data = new TextInfo(text);
}
}
public Text(boolean isNewLine, String... text) {
super("text");
StringBuilder sb = new StringBuilder();
for (String s : text) {
sb.append(s);
}
if (isNewLine) {
data = new TextInfo(sb + "\n");
} else {
data = new TextInfo(sb.toString());
}
}
@Override
public String toString() {
return data.text.trim();
}
@Data
public static class TextInfo {
String text;
public TextInfo(String text) {
this.text = text.trim();
}
}
}