mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
sync
This commit is contained in:
parent
5c219aa003
commit
6126920830
@ -1,11 +1,13 @@
|
||||
import { ReceiveCmdS } from '../hook'
|
||||
import { Group, GroupMember, GroupMemberRole, GroupNotifies, GroupNotify, GroupRequestOperateTypes } from '../types'
|
||||
import { callNTQQApi, GeneralCallResult, NTQQApiClass, NTQQApiMethod } from '../ntcall'
|
||||
import { deleteGroup, uidMaps } from '../../common/data'
|
||||
import { Group, GroupMember, GroupMemberRole, GroupNotifies, GroupRequestOperateTypes } from '../types'
|
||||
import { callNTQQApi, GeneralCallResult, NTQQApiMethod } from '../ntcall'
|
||||
import { deleteGroup } from '../../common/data'
|
||||
import { dbUtil } from '../../common/db'
|
||||
import { log } from '../../common/utils/log'
|
||||
import { NTQQWindowApi, NTQQWindows } from './window'
|
||||
import { getSession } from '../wrapper'
|
||||
import { NTEventDispatch } from '@/common/utils/EventTask'
|
||||
import { NodeIKernelGroupListener } from '../listeners'
|
||||
|
||||
export class NTQQGroupApi {
|
||||
static async activateMemberListChange() {
|
||||
@ -37,22 +39,19 @@ export class NTQQGroupApi {
|
||||
})
|
||||
}
|
||||
|
||||
static async getGroups(forced = false) {
|
||||
// let cbCmd = ReceiveCmdS.GROUPS
|
||||
// if (process.platform != 'win32') {
|
||||
// cbCmd = ReceiveCmdS.GROUPS_STORE
|
||||
// }
|
||||
const result = await callNTQQApi<{
|
||||
updateType: number
|
||||
groupList: Group[]
|
||||
}>({
|
||||
methodName: NTQQApiMethod.GROUPS,
|
||||
args: [{ force_update: forced }, undefined],
|
||||
cbCmd: [ReceiveCmdS.GROUPS, ReceiveCmdS.GROUPS_STORE],
|
||||
afterFirstCmd: false,
|
||||
})
|
||||
log('get groups result', result)
|
||||
return result.groupList
|
||||
static async getGroups(forced = false): Promise<Group[]> {
|
||||
type ListenerType = NodeIKernelGroupListener['onGroupListUpdate']
|
||||
const [, , groupList] = await NTEventDispatch.CallNormalEvent
|
||||
<(force: boolean) => Promise<any>, ListenerType>
|
||||
(
|
||||
'NodeIKernelGroupService/getGroupList',
|
||||
'NodeIKernelGroupListener/onGroupListUpdate',
|
||||
1,
|
||||
5000,
|
||||
(updateType) => true,
|
||||
forced
|
||||
)
|
||||
return groupList
|
||||
}
|
||||
|
||||
static async getGroupMembers(groupQQ: string, num = 3000): Promise<Map<string, GroupMember>> {
|
||||
|
@ -391,10 +391,12 @@ export interface RawMessage {
|
||||
chatType: ChatType
|
||||
sendStatus?: number // 消息状态,别人发的2是已撤回,自己发的2是已发送
|
||||
recallTime: string // 撤回时间, "0"是没有撤回
|
||||
records: RawMessage[]
|
||||
elements: {
|
||||
elementId: string
|
||||
elementType: ElementType
|
||||
replyElement: {
|
||||
sourceMsgIdInRecords: string
|
||||
senderUid: string // 原消息发送者QQ号
|
||||
sourceMsgIsIncPic: boolean // 原消息是否有图片
|
||||
sourceMsgText: string
|
||||
|
@ -59,7 +59,6 @@ export class OB11Constructor {
|
||||
debug,
|
||||
ob11: { messagePostFormat },
|
||||
} = config
|
||||
const message_type = msg.chatType == ChatType.group ? 'group' : 'private'
|
||||
const resMsg: OB11Message = {
|
||||
self_id: parseInt(selfInfo.uin),
|
||||
user_id: parseInt(msg.senderUin!),
|
||||
@ -67,7 +66,7 @@ export class OB11Constructor {
|
||||
message_id: msg.msgShortId!,
|
||||
real_id: msg.msgShortId!,
|
||||
message_seq: msg.msgShortId!,
|
||||
message_type: msg.chatType == ChatType.group ? 'group' : 'private',
|
||||
message_type: msg.chatType === ChatType.group ? 'group' : 'private',
|
||||
sender: {
|
||||
user_id: parseInt(msg.senderUin!),
|
||||
nickname: msg.sendNickName,
|
||||
|
Loading…
x
Reference in New Issue
Block a user