mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
Merge pull request #159 from MisakaTAT/main
feat: added an gocqhttp extended api send_forward_msg
This commit is contained in:
commit
41f0e8f574
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 4,
|
"manifest_version": 4,
|
||||||
"type": "extension",
|
"type": "extension",
|
||||||
"name": "LLOneBot v3.19.1",
|
"name": "LLOneBot v3.19.3",
|
||||||
"slug": "LLOneBot",
|
"slug": "LLOneBot",
|
||||||
"description": "LiteLoaderQQNT的OneBotApi,不支持商店在线更新",
|
"description": "使你的NTQQ支持OneBot11协议进行QQ机器人开发, 不支持商店在线更新",
|
||||||
"version": "3.19.1",
|
"version": "3.19.3",
|
||||||
"icon": "./icon.jpg",
|
"icon": "./icon.jpg",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@ -4,16 +4,16 @@ import {BrowserWindow, dialog, ipcMain} from 'electron';
|
|||||||
import * as fs from 'node:fs';
|
import * as fs from 'node:fs';
|
||||||
import {Config} from "../common/types";
|
import {Config} from "../common/types";
|
||||||
import {
|
import {
|
||||||
|
CHANNEL_CHECK_VERSION,
|
||||||
CHANNEL_ERROR,
|
CHANNEL_ERROR,
|
||||||
CHANNEL_GET_CONFIG,
|
CHANNEL_GET_CONFIG,
|
||||||
CHANNEL_LOG,
|
CHANNEL_LOG,
|
||||||
CHANNEL_CHECK_VERSION,
|
|
||||||
CHANNEL_SELECT_FILE,
|
CHANNEL_SELECT_FILE,
|
||||||
CHANNEL_SET_CONFIG,
|
CHANNEL_SET_CONFIG,
|
||||||
CHANNEL_UPDATE,
|
CHANNEL_UPDATE,
|
||||||
} from "../common/channels";
|
} from "../common/channels";
|
||||||
import {ob11WebsocketServer} from "../onebot11/server/ws/WebsocketServer";
|
import {ob11WebsocketServer} from "../onebot11/server/ws/WebsocketServer";
|
||||||
import {DATA_DIR, wrapText} from "../common/utils";
|
import {DATA_DIR} from "../common/utils";
|
||||||
import {
|
import {
|
||||||
friendRequests,
|
friendRequests,
|
||||||
getFriend,
|
getFriend,
|
||||||
@ -21,11 +21,19 @@ import {
|
|||||||
getGroupMember,
|
getGroupMember,
|
||||||
llonebotError,
|
llonebotError,
|
||||||
refreshGroupMembers,
|
refreshGroupMembers,
|
||||||
selfInfo, uidMaps
|
selfInfo,
|
||||||
|
uidMaps
|
||||||
} from "../common/data";
|
} from "../common/data";
|
||||||
import {hookNTQQApiCall, hookNTQQApiReceive, ReceiveCmdS, registerReceiveHook} from "../ntqqapi/hook";
|
import {hookNTQQApiCall, hookNTQQApiReceive, ReceiveCmdS, registerReceiveHook} from "../ntqqapi/hook";
|
||||||
import {OB11Constructor} from "../onebot11/constructor";
|
import {OB11Constructor} from "../onebot11/constructor";
|
||||||
import {ChatType, FriendRequestNotify, GroupNotifies, GroupNotifyTypes, RawMessage} from "../ntqqapi/types";
|
import {
|
||||||
|
ChatType,
|
||||||
|
FriendRequestNotify,
|
||||||
|
GroupMemberRole,
|
||||||
|
GroupNotifies,
|
||||||
|
GroupNotifyTypes,
|
||||||
|
RawMessage
|
||||||
|
} from "../ntqqapi/types";
|
||||||
import {ob11HTTPServer} from "../onebot11/server/http";
|
import {ob11HTTPServer} from "../onebot11/server/http";
|
||||||
import {OB11FriendRecallNoticeEvent} from "../onebot11/event/notice/OB11FriendRecallNoticeEvent";
|
import {OB11FriendRecallNoticeEvent} from "../onebot11/event/notice/OB11FriendRecallNoticeEvent";
|
||||||
import {OB11GroupRecallNoticeEvent} from "../onebot11/event/notice/OB11GroupRecallNoticeEvent";
|
import {OB11GroupRecallNoticeEvent} from "../onebot11/event/notice/OB11GroupRecallNoticeEvent";
|
||||||
@ -107,8 +115,8 @@ function onLoad() {
|
|||||||
const config = getConfigUtil().getConfig()
|
const config = getConfigUtil().getConfig()
|
||||||
return config;
|
return config;
|
||||||
})
|
})
|
||||||
ipcMain.on(CHANNEL_SET_CONFIG, (event, ask:boolean, config: Config) => {
|
ipcMain.on(CHANNEL_SET_CONFIG, (event, ask: boolean, config: Config) => {
|
||||||
if (!ask){
|
if (!ask) {
|
||||||
setConfig(config).then();
|
setConfig(config).then();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -285,6 +293,7 @@ function onLoad() {
|
|||||||
log("变动管理员获取成功")
|
log("变动管理员获取成功")
|
||||||
groupAdminNoticeEvent.user_id = parseInt(member1.uin);
|
groupAdminNoticeEvent.user_id = parseInt(member1.uin);
|
||||||
groupAdminNoticeEvent.sub_type = notify.type == GroupNotifyTypes.ADMIN_UNSET ? "unset" : "set";
|
groupAdminNoticeEvent.sub_type = notify.type == GroupNotifyTypes.ADMIN_UNSET ? "unset" : "set";
|
||||||
|
// member1.role = notify.type == GroupNotifyTypes.ADMIN_SET ? GroupMemberRole.admin : GroupMemberRole.normal;
|
||||||
postOB11Event(groupAdminNoticeEvent, true);
|
postOB11Event(groupAdminNoticeEvent, true);
|
||||||
} else {
|
} else {
|
||||||
log("获取群通知的成员信息失败", notify, getGroup(notify.group.groupCode));
|
log("获取群通知的成员信息失败", notify, getGroup(notify.group.groupCode));
|
||||||
@ -358,13 +367,19 @@ function onLoad() {
|
|||||||
log("llonebot pid", process.pid)
|
log("llonebot pid", process.pid)
|
||||||
llonebotError.otherError = "";
|
llonebotError.otherError = "";
|
||||||
startTime = Date.now();
|
startTime = Date.now();
|
||||||
dbUtil.getReceivedTempUinMap().then(m=>{
|
dbUtil.getReceivedTempUinMap().then(m => {
|
||||||
for (const [key, value] of Object.entries(m)) {
|
for (const [key, value] of Object.entries(m)) {
|
||||||
uidMaps[value] = key;
|
uidMaps[value] = key;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
startReceiveHook().then();
|
startReceiveHook().then();
|
||||||
NTQQGroupApi.getGroups(true).then()
|
// NTQQGroupApi.getGroups(true).then(_groups => {
|
||||||
|
// _groups.map(group => {
|
||||||
|
// if (!groups.find(g => g.groupCode == group.groupCode)) {
|
||||||
|
// groups.push(group)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
const config = getConfigUtil().getConfig()
|
const config = getConfigUtil().getConfig()
|
||||||
if (config.ob11.enableHttp) {
|
if (config.ob11.enableHttp) {
|
||||||
ob11HTTPServer.start(config.ob11.httpPort)
|
ob11HTTPServer.start(config.ob11.httpPort)
|
||||||
@ -397,7 +412,7 @@ function onLoad() {
|
|||||||
}
|
}
|
||||||
log("self info", selfInfo, globalThis.authData);
|
log("self info", selfInfo, globalThis.authData);
|
||||||
if (selfInfo.uin) {
|
if (selfInfo.uin) {
|
||||||
async function getUserNick(){
|
async function getUserNick() {
|
||||||
try {
|
try {
|
||||||
getSelfNickCount++;
|
getSelfNickCount++;
|
||||||
const userInfo = (await NTQQUserApi.getUserDetailInfo(selfInfo.uid));
|
const userInfo = (await NTQQUserApi.getUserDetailInfo(selfInfo.uid));
|
||||||
@ -413,6 +428,7 @@ function onLoad() {
|
|||||||
return setTimeout(getUserNick, 1000);
|
return setTimeout(getUserNick, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getUserNick().then()
|
getUserNick().then()
|
||||||
start().then();
|
start().then();
|
||||||
} else {
|
} else {
|
||||||
|
@ -10,7 +10,7 @@ export class NTQQGroupApi{
|
|||||||
static async getGroups(forced = false) {
|
static async getGroups(forced = false) {
|
||||||
let cbCmd = ReceiveCmdS.GROUPS
|
let cbCmd = ReceiveCmdS.GROUPS
|
||||||
if (process.platform != "win32") {
|
if (process.platform != "win32") {
|
||||||
cbCmd = ReceiveCmdS.GROUPS_UNIX
|
cbCmd = ReceiveCmdS.GROUPS_STORE
|
||||||
}
|
}
|
||||||
const result = await callNTQQApi<{
|
const result = await callNTQQApi<{
|
||||||
updateType: number,
|
updateType: number,
|
||||||
|
@ -2,7 +2,7 @@ import {BrowserWindow} from 'electron';
|
|||||||
import {NTQQApiClass} from "./ntcall";
|
import {NTQQApiClass} from "./ntcall";
|
||||||
import {NTQQMsgApi, sendMessagePool} from "./api/msg"
|
import {NTQQMsgApi, sendMessagePool} from "./api/msg"
|
||||||
import {ChatType, Group, GroupMember, RawMessage, User} from "./types";
|
import {ChatType, Group, GroupMember, RawMessage, User} from "./types";
|
||||||
import {friends, groups, selfInfo, tempGroupCodeMap, uidMaps} from "../common/data";
|
import {friends, getGroupMember, groups, selfInfo, tempGroupCodeMap, uidMaps} from "../common/data";
|
||||||
import {OB11GroupDecreaseEvent} from "../onebot11/event/notice/OB11GroupDecreaseEvent";
|
import {OB11GroupDecreaseEvent} from "../onebot11/event/notice/OB11GroupDecreaseEvent";
|
||||||
import {v4 as uuidv4} from "uuid"
|
import {v4 as uuidv4} from "uuid"
|
||||||
import {postOB11Event} from "../onebot11/server/postOB11Event";
|
import {postOB11Event} from "../onebot11/server/postOB11Event";
|
||||||
@ -25,7 +25,7 @@ export let ReceiveCmdS = {
|
|||||||
USER_INFO: "nodeIKernelProfileListener/onProfileSimpleChanged",
|
USER_INFO: "nodeIKernelProfileListener/onProfileSimpleChanged",
|
||||||
USER_DETAIL_INFO: "nodeIKernelProfileListener/onProfileDetailInfoChanged",
|
USER_DETAIL_INFO: "nodeIKernelProfileListener/onProfileDetailInfoChanged",
|
||||||
GROUPS: "nodeIKernelGroupListener/onGroupListUpdate",
|
GROUPS: "nodeIKernelGroupListener/onGroupListUpdate",
|
||||||
GROUPS_UNIX: "onGroupListUpdate",
|
GROUPS_STORE: "onGroupListUpdate",
|
||||||
GROUP_MEMBER_INFO_UPDATE: "nodeIKernelGroupListener/onMemberInfoChange",
|
GROUP_MEMBER_INFO_UPDATE: "nodeIKernelGroupListener/onMemberInfoChange",
|
||||||
FRIENDS: "onBuddyListChange",
|
FRIENDS: "onBuddyListChange",
|
||||||
MEDIA_DOWNLOAD_COMPLETE: "nodeIKernelMsgListener/onRichMediaDownloadComplete",
|
MEDIA_DOWNLOAD_COMPLETE: "nodeIKernelMsgListener/onRichMediaDownloadComplete",
|
||||||
@ -229,7 +229,6 @@ async function processGroupEvent(payload: {groupList: Group[]}) {
|
|||||||
for (const group of newGroupList) {
|
for (const group of newGroupList) {
|
||||||
let existGroup = groups.find(g => g.groupCode == group.groupCode);
|
let existGroup = groups.find(g => g.groupCode == group.groupCode);
|
||||||
if (existGroup) {
|
if (existGroup) {
|
||||||
|
|
||||||
if (existGroup.memberCount > group.memberCount) {
|
if (existGroup.memberCount > group.memberCount) {
|
||||||
log(`群(${group.groupCode})成员数量减少${existGroup.memberCount} -> ${group.memberCount}`);
|
log(`群(${group.groupCode})成员数量减少${existGroup.memberCount} -> ${group.memberCount}`);
|
||||||
const oldMembers = existGroup.members;
|
const oldMembers = existGroup.members;
|
||||||
@ -263,19 +262,35 @@ async function processGroupEvent(payload: {groupList: Group[]}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 群列表变动
|
// 群列表变动
|
||||||
registerReceiveHook<{ groupList: Group[], updateType: number }>(process.platform == "win32" ? ReceiveCmdS.GROUPS : ReceiveCmdS.GROUPS_UNIX, (payload) => {
|
registerReceiveHook<{ groupList: Group[], updateType: number }>(ReceiveCmdS.GROUPS, (payload) => {
|
||||||
log("群列表变动", payload)
|
|
||||||
if (payload.updateType != 2) {
|
if (payload.updateType != 2) {
|
||||||
updateGroups(payload.groupList).then();
|
updateGroups(payload.groupList).then();
|
||||||
} else {
|
} else {
|
||||||
|
if (process.platform == "win32") {
|
||||||
processGroupEvent(payload).then();
|
processGroupEvent(payload).then();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
registerReceiveHook<{ groupList: Group[], updateType: number }>(ReceiveCmdS.GROUPS_STORE, (payload) => {
|
||||||
|
if (payload.updateType != 2) {
|
||||||
|
updateGroups(payload.groupList).then();
|
||||||
|
} else {
|
||||||
|
if (process.platform != "win32") {
|
||||||
|
processGroupEvent(payload).then();
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
registerReceiveHook<{groupCode: string, dataSource: number, members: Set<GroupMember>}>(ReceiveCmdS.GROUP_MEMBER_INFO_UPDATE, (payload) => {
|
registerReceiveHook<{groupCode: string, dataSource: number, members: Set<GroupMember>}>(ReceiveCmdS.GROUP_MEMBER_INFO_UPDATE, async (payload) => {
|
||||||
const groupCode = payload.groupCode;
|
const groupCode = payload.groupCode;
|
||||||
const members = Array.from(payload.members.values());
|
const members = Array.from(payload.members.values());
|
||||||
// log("群成员变动", groupCode, payload.members.keys(), payload.members.values())
|
// log("群成员信息变动", groupCode, members)
|
||||||
|
for(const member of members) {
|
||||||
|
const existMember = await getGroupMember(groupCode, member.uin);
|
||||||
|
if (existMember){
|
||||||
|
Object.assign(existMember, member);
|
||||||
|
}
|
||||||
|
}
|
||||||
// const existGroup = groups.find(g => g.groupCode == groupCode);
|
// const existGroup = groups.find(g => g.groupCode == groupCode);
|
||||||
// if (existGroup) {
|
// if (existGroup) {
|
||||||
// log("对比群成员", existGroup.members, members)
|
// log("对比群成员", existGroup.members, members)
|
||||||
|
@ -162,7 +162,12 @@ export function callNTQQApi<ReturnType>(params: NTQQApiParams) {
|
|||||||
|
|
||||||
ipcMain.emit(
|
ipcMain.emit(
|
||||||
channel,
|
channel,
|
||||||
{},
|
{
|
||||||
|
sender: {
|
||||||
|
send: (..._args: unknown[]) => {
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{type: 'request', callbackId: uuid, eventName},
|
{type: 'request', callbackId: uuid, eventName},
|
||||||
apiArgs
|
apiArgs
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {GroupMemberRole} from "./group";
|
import {GroupMemberRole} from "./group";
|
||||||
|
import exp from "constants";
|
||||||
|
|
||||||
export enum ElementType {
|
export enum ElementType {
|
||||||
TEXT = 1,
|
TEXT = 1,
|
||||||
@ -209,6 +210,44 @@ export interface FaceElement {
|
|||||||
faceType: 1
|
faceType: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MarketFaceElement {
|
||||||
|
"itemType": 6,
|
||||||
|
"faceInfo": 1,
|
||||||
|
"emojiPackageId": 203875,
|
||||||
|
"subType": 3,
|
||||||
|
"mediaType": 0,
|
||||||
|
"imageWidth": 200,
|
||||||
|
"imageHeight": 200,
|
||||||
|
"faceName": string,
|
||||||
|
"emojiId": "094d53bd1c9ac5d35d04b08e8a6c992c",
|
||||||
|
"key": "a8b1dd0aebc8d910",
|
||||||
|
"param": null,
|
||||||
|
"mobileParam": null,
|
||||||
|
"sourceType": null,
|
||||||
|
"startTime": null,
|
||||||
|
"endTime": null,
|
||||||
|
"emojiType": 1,
|
||||||
|
"hasIpProduct": null,
|
||||||
|
"voiceItemHeightArr": null,
|
||||||
|
"sourceName": null,
|
||||||
|
"sourceJumpUrl": null,
|
||||||
|
"sourceTypeName": null,
|
||||||
|
"backColor": null,
|
||||||
|
"volumeColor": null,
|
||||||
|
"staticFacePath": "E:\\SystemDocuments\\QQ\\721011692\\nt_qq\\nt_data\\Emoji\\marketface\\203875\\094d53bd1c9ac5d35d04b08e8a6c992c_aio.png",
|
||||||
|
"dynamicFacePath": "E:\\SystemDocuments\\QQ\\721011692\\nt_qq\\nt_data\\Emoji\\marketface\\203875\\094d53bd1c9ac5d35d04b08e8a6c992c",
|
||||||
|
"supportSize": [
|
||||||
|
{
|
||||||
|
"width": 300,
|
||||||
|
"height": 300
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"width": 200,
|
||||||
|
"height": 200
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"apngSupportSize": null
|
||||||
|
}
|
||||||
export interface VideoElement {
|
export interface VideoElement {
|
||||||
"filePath": string,
|
"filePath": string,
|
||||||
"fileName": string,
|
"fileName": string,
|
||||||
@ -321,5 +360,6 @@ export interface RawMessage {
|
|||||||
faceElement: FaceElement;
|
faceElement: FaceElement;
|
||||||
videoElement: VideoElement;
|
videoElement: VideoElement;
|
||||||
fileElement: FileElement;
|
fileElement: FileElement;
|
||||||
|
marketFaceElement: MarketFaceElement;
|
||||||
}[];
|
}[];
|
||||||
}
|
}
|
@ -1,18 +1,22 @@
|
|||||||
import SendMsg from "../msg/SendMsg";
|
import SendMsg, {convertMessage2List} from "../msg/SendMsg";
|
||||||
import {OB11PostSendMsg} from "../../types";
|
import {OB11PostSendMsg} from "../../types";
|
||||||
import {ActionName} from "../types";
|
import {ActionName} from "../types";
|
||||||
|
|
||||||
export class GoCQHTTPSendGroupForwardMsg extends SendMsg {
|
export class GoCQHTTPSendForwardMsg extends SendMsg {
|
||||||
actionName = ActionName.GoCQHTTP_SendGroupForwardMsg;
|
actionName = ActionName.GoCQHTTP_SendForwardMsg;
|
||||||
|
|
||||||
protected async check(payload: OB11PostSendMsg) {
|
protected async check(payload: OB11PostSendMsg) {
|
||||||
if (payload.messages){
|
if (payload.user_id) this.actionName = ActionName.GoCQHTTP_SendPrivateForwardMsg;
|
||||||
payload.message = this.convertMessage2List(payload.messages);
|
if (payload.group_id) this.actionName = ActionName.GoCQHTTP_SendGroupForwardMsg;
|
||||||
}
|
if (payload.messages) payload.message = convertMessage2List(payload.messages);
|
||||||
return super.check(payload);
|
return super.check(payload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GoCQHTTPSendPrivateForwardMsg extends GoCQHTTPSendGroupForwardMsg {
|
export class GoCQHTTPSendPrivateForwardMsg extends GoCQHTTPSendForwardMsg {
|
||||||
actionName = ActionName.GoCQHTTP_SendPrivateForwardMsg;
|
actionName = ActionName.GoCQHTTP_SendPrivateForwardMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class GoCQHTTPSendGroupForwardMsg extends GoCQHTTPSendForwardMsg {
|
||||||
|
actionName = ActionName.GoCQHTTP_SendGroupForwardMsg;
|
||||||
|
}
|
@ -3,12 +3,18 @@ import {OB11Constructor} from "../../constructor";
|
|||||||
import {groups} from "../../../common/data";
|
import {groups} from "../../../common/data";
|
||||||
import BaseAction from "../BaseAction";
|
import BaseAction from "../BaseAction";
|
||||||
import {ActionName} from "../types";
|
import {ActionName} from "../types";
|
||||||
|
import {NTQQGroupApi} from "../../../ntqqapi/api";
|
||||||
|
import {log} from "../../../common/utils";
|
||||||
|
|
||||||
|
|
||||||
class GetGroupList extends BaseAction<null, OB11Group[]> {
|
class GetGroupList extends BaseAction<null, OB11Group[]> {
|
||||||
actionName = ActionName.GetGroupList
|
actionName = ActionName.GetGroupList
|
||||||
|
|
||||||
protected async _handle(payload: null) {
|
protected async _handle(payload: null) {
|
||||||
|
// if (groups.length === 0) {
|
||||||
|
// const groups = await NTQQGroupApi.getGroups(true)
|
||||||
|
// log("get groups", groups)
|
||||||
|
// }
|
||||||
return OB11Constructor.groups(groups);
|
return OB11Constructor.groups(groups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import GetVersionInfo from "./system/GetVersionInfo";
|
|||||||
import CanSendRecord from "./system/CanSendRecord";
|
import CanSendRecord from "./system/CanSendRecord";
|
||||||
import CanSendImage from "./system/CanSendImage";
|
import CanSendImage from "./system/CanSendImage";
|
||||||
import GetStatus from "./system/GetStatus";
|
import GetStatus from "./system/GetStatus";
|
||||||
import {GoCQHTTPSendGroupForwardMsg, GoCQHTTPSendPrivateForwardMsg} from "./go-cqhttp/SendForwardMsg";
|
import {GoCQHTTPSendForwardMsg, GoCQHTTPSendGroupForwardMsg, GoCQHTTPSendPrivateForwardMsg} from "./go-cqhttp/SendForwardMsg";
|
||||||
import GoCQHTTPGetStrangerInfo from "./go-cqhttp/GetStrangerInfo";
|
import GoCQHTTPGetStrangerInfo from "./go-cqhttp/GetStrangerInfo";
|
||||||
import SendLike from "./user/SendLike";
|
import SendLike from "./user/SendLike";
|
||||||
import SetGroupAddRequest from "./group/SetGroupAddRequest";
|
import SetGroupAddRequest from "./group/SetGroupAddRequest";
|
||||||
@ -73,6 +73,7 @@ export const actionHandlers = [
|
|||||||
new CleanCache(),
|
new CleanCache(),
|
||||||
|
|
||||||
//以下为go-cqhttp api
|
//以下为go-cqhttp api
|
||||||
|
new GoCQHTTPSendForwardMsg(),
|
||||||
new GoCQHTTPSendGroupForwardMsg(),
|
new GoCQHTTPSendGroupForwardMsg(),
|
||||||
new GoCQHTTPSendPrivateForwardMsg(),
|
new GoCQHTTPSendPrivateForwardMsg(),
|
||||||
new GoCQHTTPGetStrangerInfo(),
|
new GoCQHTTPGetStrangerInfo(),
|
||||||
|
@ -51,6 +51,7 @@ export enum ActionName {
|
|||||||
GetRecord = "get_record",
|
GetRecord = "get_record",
|
||||||
CleanCache = "clean_cache",
|
CleanCache = "clean_cache",
|
||||||
// 以下为go-cqhttp api
|
// 以下为go-cqhttp api
|
||||||
|
GoCQHTTP_SendForwardMsg = "send_forward_msg",
|
||||||
GoCQHTTP_SendGroupForwardMsg = "send_group_forward_msg",
|
GoCQHTTP_SendGroupForwardMsg = "send_group_forward_msg",
|
||||||
GoCQHTTP_SendPrivateForwardMsg = "send_private_forward_msg",
|
GoCQHTTP_SendPrivateForwardMsg = "send_private_forward_msg",
|
||||||
GoCQHTTP_GetStrangerInfo = "get_stranger_info",
|
GoCQHTTP_GetStrangerInfo = "get_stranger_info",
|
||||||
|
@ -203,6 +203,9 @@ export class OB11Constructor {
|
|||||||
} else if (element.faceElement) {
|
} else if (element.faceElement) {
|
||||||
message_data["type"] = OB11MessageDataType.face;
|
message_data["type"] = OB11MessageDataType.face;
|
||||||
message_data["data"]["id"] = element.faceElement.faceIndex.toString();
|
message_data["data"]["id"] = element.faceElement.faceIndex.toString();
|
||||||
|
} else if (element.marketFaceElement) {
|
||||||
|
message_data["type"] = OB11MessageDataType.mface;
|
||||||
|
message_data["data"]["text"] = element.marketFaceElement.faceName;
|
||||||
}
|
}
|
||||||
if (message_data.type !== "unknown" && message_data.data) {
|
if (message_data.type !== "unknown" && message_data.data) {
|
||||||
const cqCode = encodeCQCode(message_data);
|
const cqCode = encodeCQCode(message_data);
|
||||||
@ -224,8 +227,9 @@ export class OB11Constructor {
|
|||||||
if (msg.senderUin){
|
if (msg.senderUin){
|
||||||
let member = await getGroupMember(msg.peerUid, msg.senderUin);
|
let member = await getGroupMember(msg.peerUid, msg.senderUin);
|
||||||
if (member && member.cardName !== msg.sendMemberName) {
|
if (member && member.cardName !== msg.sendMemberName) {
|
||||||
|
const event = new OB11GroupCardEvent(parseInt(msg.peerUid), parseInt(msg.senderUin), msg.sendMemberName, member.cardName)
|
||||||
member.cardName = msg.sendMemberName;
|
member.cardName = msg.sendMemberName;
|
||||||
return new OB11GroupCardEvent(parseInt(msg.peerUid), parseInt(msg.senderUin), msg.sendMemberName, member.cardName)
|
return event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// log("group msg", msg);
|
// log("group msg", msg);
|
||||||
|
@ -108,10 +108,16 @@ export enum OB11MessageDataType {
|
|||||||
reply = "reply",
|
reply = "reply",
|
||||||
json = "json",
|
json = "json",
|
||||||
face = "face",
|
face = "face",
|
||||||
mface = "face", // 商城表情
|
mface = "mface", // 商城表情
|
||||||
node = "node", // 合并转发消息
|
node = "node", // 合并转发消息
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface OB11MessageMFace{
|
||||||
|
type: OB11MessageDataType.mface,
|
||||||
|
data: {
|
||||||
|
text: string
|
||||||
|
}
|
||||||
|
}
|
||||||
export interface OB11MessageText {
|
export interface OB11MessageText {
|
||||||
type: OB11MessageDataType.text,
|
type: OB11MessageDataType.text,
|
||||||
data: {
|
data: {
|
||||||
@ -199,7 +205,7 @@ export interface OB11MessageJson {
|
|||||||
|
|
||||||
export type OB11MessageData =
|
export type OB11MessageData =
|
||||||
OB11MessageText |
|
OB11MessageText |
|
||||||
OB11MessageFace |
|
OB11MessageFace | OB11MessageMFace |
|
||||||
OB11MessageAt | OB11MessageReply |
|
OB11MessageAt | OB11MessageReply |
|
||||||
OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo |
|
OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo |
|
||||||
OB11MessageNode | OB11MessageCustomMusic | OB11MessageJson
|
OB11MessageNode | OB11MessageCustomMusic | OB11MessageJson
|
||||||
|
@ -150,7 +150,7 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
),
|
),
|
||||||
SettingItem(
|
SettingItem(
|
||||||
'日志文件目录',
|
'日志文件目录',
|
||||||
`${window.LiteLoader.plugins['LLOneBot'].path.data}`,
|
`${window.LiteLoader.plugins['LLOneBot'].path.data}/logs`,
|
||||||
SettingButton('打开', 'config-open-log-path'),
|
SettingButton('打开', 'config-open-log-path'),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "3.19.1"
|
export const version = "3.19.3"
|
Loading…
x
Reference in New Issue
Block a user