KQCodeUtils
模组,并弃用原版工具类@Deprecated public class CQCodeUtil extends Object
KQCodeUtils
,
http://simple-robot-doc.forte.love/1644790
Modifier and Type | Method and Description |
---|---|
static CQCodeUtil |
build()
Deprecated.
获取CQCodeUtil实例对象
|
String |
escapeOutCQCode(String msgOutCQCode)
Deprecated.
字符串转义-不在CQ码内的消息
对于不在CQ码内的消息(即文本消息),为了防止解析混淆,需要进行转义。
转义规则如下:
& -> &
[ -> [
] -> ]
|
String |
escapeOutCQCodeDecode(String noCQCodeMsg)
Deprecated.
将一个没有CQ码的字符串进行解码
nullable
|
String |
escapeValue(String value)
Deprecated.
对于CQ码中的value(参数值),为了防止解析混淆,需要进行转义。
此方法大概仅需要内部使用
转义规则如下:
& -> &
[ -> [
] -> ]
, -> ,
|
String |
escapeValueDecode(String value)
Deprecated.
对参数进行解码
|
String |
getCQCode_anonymous()
Deprecated.
|
CQCode |
getCQCode_Anonymous()
Deprecated.
匿名发消息(仅支持群消息使用)
本CQ码需加在消息的开头。
参数被忽略,代表强制使用匿名,如果匿名失败将取消该消息的发送。
|
String |
getCQCode_anonymous(Boolean ignore)
Deprecated.
|
CQCode |
getCQCode_Anonymous(Boolean ignore)
Deprecated.
匿名发消息(仅支持群消息使用)
本CQ码需加在消息的开头。
|
String |
getCQCode_at(String qq)
Deprecated.
|
CQCode |
getCQCode_At(String qq)
Deprecated.
at某人
|
String |
getCQCode_atAll()
Deprecated.
|
CQCode |
getCQCode_AtAll()
Deprecated.
at全体
|
String |
getCQCode_bface(String id)
Deprecated.
|
CQCode |
getCQCode_Bface(String id)
Deprecated.
获取原创表情
|
String |
getCQCode_dice(String type)
Deprecated.
|
CQCode |
getCQCode_Dice(String type)
Deprecated.
掷骰子魔法表情
|
String |
getCQCode_emoji(String id)
Deprecated.
|
CQCode |
getCQCode_Emoji(String id)
Deprecated.
生成emoji
|
String |
getCQCode_face(String id)
Deprecated.
|
CQCode |
getCQCode_Face(String id)
Deprecated.
获取face字符表情
|
String |
getCQCode_image(String file)
Deprecated.
|
CQCode |
getCQCode_Image(String file)
Deprecated.
发送自定义图片
|
String |
getCQCode_music_custom(String url,
String audio,
String title,
String content,
String image)
Deprecated.
|
CQCode |
getCQCode_Music_Custom(String url,
String audio,
String title,
String content,
String image)
Deprecated.
发送音乐自定义分享
|
String |
getCQCode_music(String type,
String id)
Deprecated.
|
CQCode |
getCQCode_Music(String type,
String id)
Deprecated.
发送音乐
注意:音乐只能作为单独的一条消息发送
|
String |
getCQCode_record(String file)
Deprecated.
|
CQCode |
getCQCode_Record(String file)
Deprecated.
发送语音
|
String |
getCQCode_record(String file,
Boolean magic)
Deprecated.
|
CQCode |
getCQCode_Record(String file,
Boolean magic)
Deprecated.
发送语音
|
String |
getCQCode_rps(String type)
Deprecated.
|
CQCode |
getCQCode_Rps(String type)
Deprecated.
发送猜拳魔法表情
|
String |
getCQCode_sface(String id)
Deprecated.
|
CQCode |
getCQCode_Sface(String id)
Deprecated.
小表情
|
String |
getCQCode_shake()
Deprecated.
|
CQCode |
getCQCode_Shake()
Deprecated.
戳一戳 仅支持好友消息使用
|
String |
getCQCode_share(String url,
String title,
String content,
String image)
Deprecated.
|
CQCode |
getCQCode_Share(String url,
String title,
String content,
String image)
Deprecated.
发送链接分享
注意:链接分享只能作为单独的一条消息发送
|
CQCode |
getCQCode(CQCodeTypes type,
String... params)
Deprecated.
|
List<CQCode> |
getCQCodeFromMsg(String msg)
Deprecated.
从信息字符串中提取出CQCode码对象
|
List<CQCode> |
getCQCodeFromMsgByType(String msg,
CQCodeTypes types)
Deprecated.
从信息字符串中提取出指定类型的CQCode码对象
|
List<CQCode> |
getCQCodeFromMsgByType(String msg,
String typeStr)
Deprecated.
从信息字符串中提取出指定类型的CQCode码对象
|
List<String> |
getCQCodeStrFromMsg(String msg)
Deprecated.
从信息字符串中提取出CQCode码的字符串
|
List<String> |
getCQCodeStrFromMsgByType(String msg,
CQCodeTypes types)
Deprecated.
从信息字符串中提取出指定类型的CQCode码的字符串
|
List<String> |
getCQCodeStrFromMsgByType(String msg,
String typeFunction)
Deprecated.
从信息字符串中提取出指定类型的CQCode码的字符串
|
boolean |
isAt(MsgGet msgget)
Deprecated.
|
boolean |
isAt(String msg,
long qq)
Deprecated.
判断是否存在at某个qq
|
boolean |
isAt(String msg,
String qq)
Deprecated.
判断是否存在at某个qq
|
boolean |
isContains(CQCodeTypes types,
String text)
Deprecated.
判断某个字符串中是否存在某类型的CQ码
|
String |
removeCQCodeFromMsg(String msg)
Deprecated.
从信息字符串中移除CQCode字符串
|
String |
removeCQCodeFromMsg(String msg,
CQCodeTypes cqCodeTypes)
Deprecated.
从信息字符串中移除某种类型的CQCode字符串
|
AppendList |
splitToList(String msg)
Deprecated.
根据消息内容对普通消息与CQ码相关消息进行分隔。
消息需要是转义前的消息,否则会出现问题。
|
CQCode |
toCQCode(String cq)
Deprecated.
将CQ码字符串转化为CQCode类型, 会去除空格
|
public static CQCodeUtil build()
public String escapeOutCQCode(String msgOutCQCode)
public String escapeOutCQCodeDecode(String noCQCodeMsg)
noCQCodeMsg
- public String escapeValue(String value)
value
- 参数值的字符串public String escapeValueDecode(String value)
value
- 参数值的字符串public CQCode getCQCode(CQCodeTypes type, String... params)
public String getCQCode_face(String id)
id
- moji字符的unicode编号getCQCode_Face(String)
public CQCode getCQCode_Face(String id)
id
- moji字符的unicode编号public String getCQCode_bface(String id)
id
- 原创表情的IDgetCQCode_Bface(String)
public CQCode getCQCode_Bface(String id)
id
- 原创表情的IDpublic String getCQCode_sface(String id)
id
- 小表情的IDgetCQCode_Sface(String)
public CQCode getCQCode_Sface(String id)
id
- 小表情的IDpublic String getCQCode_image(String file)
file
- 图片文件名称getCQCode_Image(String)
public CQCode getCQCode_Image(String file)
file
- 图片文件名称public String getCQCode_record(String file, Boolean magic)
file
- 音频文件名称magic
- 是否为变声getCQCode_Record(String, Boolean)
public CQCode getCQCode_Record(String file, Boolean magic)
file
- 音频文件名称magic
- 是否为变声public String getCQCode_record(String file)
file
- 音频文件名称getCQCode_Record(String)
public CQCode getCQCode_Record(String file)
file
- 音频文件名称public String getCQCode_at(String qq)
qq
- qq号getCQCode_At(String)
public CQCode getCQCode_At(String qq)
qq
- qq号public String getCQCode_atAll()
getCQCode_At(String)
public CQCode getCQCode_AtAll()
public String getCQCode_rps(String type)
type
- 为猜拳结果的类型,暂不支持发送时自定义。该参数可被忽略。getCQCode_Rps(String)
public CQCode getCQCode_Rps(String type)
type
- 为猜拳结果的类型,暂不支持发送时自定义。该参数可被忽略。public String getCQCode_dice(String type)
type
- 对应掷出的点数,暂不支持发送时自定义。该参数可被忽略。getCQCode_Dice(String)
public CQCode getCQCode_Dice(String type)
type
- 对应掷出的点数,暂不支持发送时自定义。该参数可被忽略。public String getCQCode_shake()
getCQCode_Shake()
public CQCode getCQCode_Shake()
public String getCQCode_anonymous(Boolean ignore)
ignore
- 当{1}为true时,代表不强制使用匿名,如果匿名失败将转为普通消息发送。
当{1}为false或ignore参数被忽略时,代表强制使用匿名,如果匿名失败将取消该消息的发送。getCQCode_Anonymous(Boolean)
public CQCode getCQCode_Anonymous(Boolean ignore)
ignore
- 当{1}为true时,代表不强制使用匿名,如果匿名失败将转为普通消息发送。
当{1}为false或ignore参数被忽略时,代表强制使用匿名,如果匿名失败将取消该消息的发送。public String getCQCode_anonymous()
getCQCode_Anonymous()
public CQCode getCQCode_Anonymous()
public String getCQCode_music(String type, String id)
type
- 为音乐平台类型,目前支持qq、163、xiamiid
- 为对应音乐平台的数字音乐idgetCQCode_Music(String, String)
public CQCode getCQCode_Music(String type, String id)
type
- 为音乐平台类型,目前支持qq、163、xiamiid
- 为对应音乐平台的数字音乐idpublic String getCQCode_music_custom(String url, String audio, String title, String content, String image)
url
- 为分享链接,即点击分享后进入的音乐页面(如歌曲介绍页)。audio
- 为音频链接(如mp3链接)。title
- 为音乐的标题,建议12字以内。content
- 为音乐的简介,建议30字以内。该参数可被忽略。image
- 为音乐的封面图片链接。若参数为空或被忽略,则显示默认图片。getCQCode_Music_Custom(String, String, String, String, String)
public CQCode getCQCode_Music_Custom(String url, String audio, String title, String content, String image)
url
- 为分享链接,即点击分享后进入的音乐页面(如歌曲介绍页)。audio
- 为音频链接(如mp3链接)。title
- 为音乐的标题,建议12字以内。content
- 为音乐的简介,建议30字以内。该参数可被忽略。image
- 为音乐的封面图片链接。该参数可被忽略。若参数为空或被忽略,则显示默认图片。public String getCQCode_share(String url, String title, String content, String image)
url
- 为分享链接。title
- 为分享的标题,建议12字以内。content
- 为分享的简介,建议30字以内。该参数可被忽略。image
- 为分享的图片链接。若参数为空或被忽略,则显示默认图片。getCQCode_Share(String, String, String, String)
public CQCode getCQCode_Share(String url, String title, String content, String image)
url
- 为分享链接。title
- 为分享的标题,建议12字以内。content
- 为分享的简介,建议30字以内。该参数可被忽略。image
- 为分享的图片链接。若参数为空或被忽略,则显示默认图片。public String getCQCode_emoji(String id)
id
- emoji的idgetCQCode_Emoji(String)
public CQCode getCQCode_Emoji(String id)
id
- emoji的idpublic List<String> getCQCodeStrFromMsg(String msg)
msg
- 信息字符串public List<String> getCQCodeStrFromMsgByType(String msg, CQCodeTypes types)
msg
- 消息字符串types
- CQ码类型public List<String> getCQCodeStrFromMsgByType(String msg, String typeFunction)
msg
- 消息字符串public String removeCQCodeFromMsg(String msg)
msg
- 字符串public String removeCQCodeFromMsg(String msg, CQCodeTypes cqCodeTypes)
msg
- 字符串cqCodeTypes
- CQ码类型public List<CQCode> getCQCodeFromMsg(String msg)
msg
- 信息字符串 如果为空则返回空字符串public List<CQCode> getCQCodeFromMsgByType(String msg, CQCodeTypes types)
msg
- 字符串types
- 类型public List<CQCode> getCQCodeFromMsgByType(String msg, String typeStr)
msg
- 字符串typeStr
- 类型字符串public boolean isAt(MsgGet msgget)
public boolean isAt(String msg, long qq)
public boolean isContains(CQCodeTypes types, String text)
types
- CQ码类型text
- 字符串public CQCode toCQCode(String cq)
cq
- cq字符串CQParseException
- 当字符串无法转化为cq码对象的时候将会抛出此异常public AppendList splitToList(String msg)
msg
- 消息正文Copyright © 2020. All rights reserved.