mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
Merge pull request #228 from LLOneBot/dev
feat: Quick operation reply auto quote original message
This commit is contained in:
commit
807ef3b700
@ -1,5 +1,5 @@
|
|||||||
import BaseAction from '../BaseAction'
|
import BaseAction from '../BaseAction'
|
||||||
import { handleQuickOperation, QuickOperation, QuickOperationEvent } from '../../server/quick-operation'
|
import { handleQuickOperation, QuickOperation, QuickOperationEvent } from '../quick-operation'
|
||||||
import { log } from '@/common/utils'
|
import { log } from '@/common/utils'
|
||||||
import { ActionName } from '../types'
|
import { ActionName } from '../types'
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
// handle quick action, create at 2024-5-18 10:54:39 by linyuchen
|
// handle quick action, create at 2024-5-18 10:54:39 by linyuchen
|
||||||
|
|
||||||
|
|
||||||
import { OB11Message, OB11MessageAt, OB11MessageData } from '../types'
|
import { OB11Message, OB11MessageAt, OB11MessageData, OB11MessageDataType } from '../types'
|
||||||
import { OB11FriendRequestEvent } from '../event/request/OB11FriendRequest'
|
import { OB11FriendRequestEvent } from '../event/request/OB11FriendRequest'
|
||||||
import { OB11GroupRequestEvent } from '../event/request/OB11GroupRequest'
|
import { OB11GroupRequestEvent } from '../event/request/OB11GroupRequest'
|
||||||
import { dbUtil } from '@/common/db'
|
import { dbUtil } from '@/common/db'
|
||||||
import { NTQQFriendApi, NTQQGroupApi, NTQQMsgApi, Peer } from '@/ntqqapi/api'
|
import { NTQQFriendApi, NTQQGroupApi, NTQQMsgApi, Peer } from '@/ntqqapi/api'
|
||||||
import { ChatType, Group, GroupRequestOperateTypes } from '@/ntqqapi/types'
|
import { ChatType, Group, GroupRequestOperateTypes } from '@/ntqqapi/types'
|
||||||
import { getGroup, getUidByUin } from '@/common/data'
|
import { getGroup, getUidByUin } from '@/common/data'
|
||||||
import { convertMessage2List, createSendElements, sendMsg } from '../action/msg/SendMsg'
|
import { convertMessage2List, createSendElements, sendMsg } from './msg/SendMsg'
|
||||||
import { isNull, log } from '@/common/utils'
|
import { isNull, log } from '@/common/utils'
|
||||||
|
|
||||||
|
|
||||||
@ -80,7 +80,14 @@ 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[] = [
|
||||||
|
{
|
||||||
|
type: OB11MessageDataType.reply,
|
||||||
|
data: {
|
||||||
|
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())
|
@ -7,7 +7,7 @@ import { wsReply } from './ws/reply'
|
|||||||
import { log } from '@/common/utils'
|
import { log } from '@/common/utils'
|
||||||
import { getConfigUtil } from '@/common/config'
|
import { getConfigUtil } from '@/common/config'
|
||||||
import crypto from 'crypto'
|
import crypto from 'crypto'
|
||||||
import { handleQuickOperation, QuickOperationEvent } from './quick-operation'
|
import { handleQuickOperation, QuickOperationEvent } from '../action/quick-operation'
|
||||||
|
|
||||||
export type PostEventType = OB11Message | OB11BaseMetaEvent | OB11BaseNoticeEvent
|
export type PostEventType = OB11Message | OB11BaseMetaEvent | OB11BaseNoticeEvent
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user