mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
commit
e6b0eaa46d
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 4,
|
"manifest_version": 4,
|
||||||
"type": "extension",
|
"type": "extension",
|
||||||
"name": "LLOneBot v3.26.1",
|
"name": "LLOneBot v3.26.2",
|
||||||
"slug": "LLOneBot",
|
"slug": "LLOneBot",
|
||||||
"description": "使你的NTQQ支持OneBot11协议进行QQ机器人开发, 不支持商店在线更新",
|
"description": "使你的NTQQ支持OneBot11协议进行QQ机器人开发, 不支持商店在线更新",
|
||||||
"version": "3.26.1",
|
"version": "3.26.2",
|
||||||
"icon": "./icon.jpg",
|
"icon": "./icon.jpg",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,7 @@ export class ConfigUtil {
|
|||||||
enableWsReverse: false,
|
enableWsReverse: false,
|
||||||
messagePostFormat: 'array',
|
messagePostFormat: 'array',
|
||||||
enableHttpHeart: false,
|
enableHttpHeart: false,
|
||||||
|
enableQOAutoQuote: false
|
||||||
}
|
}
|
||||||
let defaultConfig: Config = {
|
let defaultConfig: Config = {
|
||||||
ob11: ob11Default,
|
ob11: ob11Default,
|
||||||
|
@ -10,6 +10,7 @@ export interface OB11Config {
|
|||||||
enableWsReverse?: boolean
|
enableWsReverse?: boolean
|
||||||
messagePostFormat?: 'array' | 'string'
|
messagePostFormat?: 'array' | 'string'
|
||||||
enableHttpHeart?: boolean
|
enableHttpHeart?: boolean
|
||||||
|
enableQOAutoQuote: boolean // 快速操作回复自动引用原消息
|
||||||
}
|
}
|
||||||
export interface CheckVersion {
|
export interface CheckVersion {
|
||||||
result: boolean
|
result: boolean
|
||||||
|
@ -10,6 +10,7 @@ import { ChatType, Group, GroupRequestOperateTypes } from '@/ntqqapi/types'
|
|||||||
import { getGroup, getUidByUin } from '@/common/data'
|
import { getGroup, getUidByUin } from '@/common/data'
|
||||||
import { convertMessage2List, createSendElements, sendMsg } from './msg/SendMsg'
|
import { convertMessage2List, createSendElements, sendMsg } from './msg/SendMsg'
|
||||||
import { isNull, log } from '@/common/utils'
|
import { isNull, log } from '@/common/utils'
|
||||||
|
import { getConfigUtil } from '@/common/config'
|
||||||
|
|
||||||
|
|
||||||
interface QuickOperationPrivateMessage {
|
interface QuickOperationPrivateMessage {
|
||||||
@ -49,8 +50,8 @@ export async function handleQuickOperation(context: QuickOperationEvent, quickAc
|
|||||||
handleMsg(context as OB11Message, quickAction).then().catch(log)
|
handleMsg(context as OB11Message, quickAction).then().catch(log)
|
||||||
}
|
}
|
||||||
if (context.post_type === 'request') {
|
if (context.post_type === 'request') {
|
||||||
const friendRequest = context as OB11FriendRequestEvent;
|
const friendRequest = context as OB11FriendRequestEvent
|
||||||
const groupRequest = context as OB11GroupRequestEvent;
|
const groupRequest = context as OB11GroupRequestEvent
|
||||||
if ((friendRequest).request_type === 'friend') {
|
if ((friendRequest).request_type === 'friend') {
|
||||||
handleFriendRequest(friendRequest, quickAction).then().catch(log)
|
handleFriendRequest(friendRequest, quickAction).then().catch(log)
|
||||||
}
|
}
|
||||||
@ -64,6 +65,7 @@ async function handleMsg(msg: OB11Message, quickAction: QuickOperationPrivateMes
|
|||||||
msg = msg as OB11Message
|
msg = msg as OB11Message
|
||||||
const rawMessage = await dbUtil.getMsgByShortId(msg.message_id)
|
const rawMessage = await dbUtil.getMsgByShortId(msg.message_id)
|
||||||
const reply = quickAction.reply
|
const reply = quickAction.reply
|
||||||
|
const ob11Config = getConfigUtil().getConfig().ob11
|
||||||
let peer: Peer = {
|
let peer: Peer = {
|
||||||
chatType: ChatType.friend,
|
chatType: ChatType.friend,
|
||||||
peerUid: msg.user_id.toString(),
|
peerUid: msg.user_id.toString(),
|
||||||
@ -80,14 +82,15 @@ async function handleMsg(msg: OB11Message, quickAction: QuickOperationPrivateMes
|
|||||||
}
|
}
|
||||||
if (reply) {
|
if (reply) {
|
||||||
let group: Group = null
|
let group: Group = null
|
||||||
let replyMessage: OB11MessageData[] = [
|
let replyMessage: OB11MessageData[] = []
|
||||||
{
|
if (ob11Config.enableQOAutoQuote) {
|
||||||
|
replyMessage.push({
|
||||||
type: OB11MessageDataType.reply,
|
type: OB11MessageDataType.reply,
|
||||||
data: {
|
data: {
|
||||||
id: msg.message_id.toString(),
|
id: msg.message_id.toString(),
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
]
|
}
|
||||||
|
|
||||||
if (msg.message_type == 'group') {
|
if (msg.message_type == 'group') {
|
||||||
group = await getGroup(msg.group_id.toString())
|
group = await getGroup(msg.group_id.toString())
|
||||||
|
@ -171,6 +171,11 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
`<div class="q-input" style="width:210px;"><input class="q-input__inner" data-config-key="musicSignUrl" type="text" value="${config.musicSignUrl}" placeholder="未设置" /></div>`,
|
`<div class="q-input" style="width:210px;"><input class="q-input__inner" data-config-key="musicSignUrl" type="text" value="${config.musicSignUrl}" placeholder="未设置" /></div>`,
|
||||||
'config-musicSignUrl',
|
'config-musicSignUrl',
|
||||||
),
|
),
|
||||||
|
SettingItem(
|
||||||
|
'快速操作回复自动引用原消息',
|
||||||
|
null,
|
||||||
|
SettingSwitch('ob11.enableQOAutoQuote', config.ob11.enableQOAutoQuote, { 'control-display-id': 'config-ob11-enableQOAutoQuote' }),
|
||||||
|
),
|
||||||
SettingItem('', null, SettingButton('保存', 'config-ob11-save', 'primary')),
|
SettingItem('', null, SettingButton('保存', 'config-ob11-save', 'primary')),
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = '3.26.1'
|
export const version = '3.26.2'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user