mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 13:01:14 +00:00
build: 1.4.0-beta4-兼容9.7.x换行符
This commit is contained in:
parent
480abcb853
commit
943dbbefd3
@ -69,7 +69,13 @@ const _handlers: {
|
||||
context: MessageContext
|
||||
) => SendMessageElement | undefined | Promise<SendMessageElement | undefined>
|
||||
} = {
|
||||
[OB11MessageDataType.text]: ({ data: { text } }) => SendMsgElementConstructor.text(text),
|
||||
[OB11MessageDataType.text]: ({ data: { text } }) => {
|
||||
//如果匹配\n \r\n失败则 将全部\r转换为\n 兼容QQ 9.7.x(非NT架构)
|
||||
if (!text.match(/\r\n/g) && !text.match(/\n/g)) {
|
||||
text = text.replace(/\r/g, '\n');
|
||||
}
|
||||
return SendMsgElementConstructor.text(text);
|
||||
},
|
||||
|
||||
[OB11MessageDataType.at]: async ({ data: { qq: atQQ } }, context) => {
|
||||
if (!context.group) return undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user